Skip to content

Commit d3b784d

Browse files
author
Charlie Kassel
committed
simplify math
1 parent cf7a09d commit d3b784d

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/Illuminate/Validation/Concerns/ValidatesAttributes.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -478,8 +478,7 @@ protected function failsRatioCheck($parameters, $width, $height)
478478
[1, 1], array_filter(sscanf($parameters['ratio'], '%f/%d'))
479479
);
480480

481-
$maxDimension = max($width, $height);
482-
$precision = $maxDimension / $maxDimension ** 2;
481+
$precision = 1 / max($width, $height);
483482

484483
return abs($numerator / $denominator - $width / $height) > $precision;
485484
}

0 commit comments

Comments
 (0)