Skip to content

Commit 4954541

Browse files
committed
Make some slight coding style fixes
1 parent 7bf6939 commit 4954541

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

References.php

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -230,20 +230,23 @@ public function threshold(string $threshold): string
230230
{
231231
$threshold = \trim($threshold);
232232

233+
if (is_numeric($threshold)) {
234+
return $threshold;
235+
}
236+
233237
if (substr($threshold, -1) == '%') {
234-
$percent_num = substr($threshold, 0, -1);
235-
if (is_numeric($percent_num)) {
238+
$percentNumber = substr($threshold, 0, -1);
239+
if (is_numeric($percentNumber)) {
236240
return $threshold;
237241
}
238-
} else if (is_numeric($threshold)) {
239-
return $threshold;
240242
}
241243

242244
throw new \InvalidArgumentException(\sprintf(
243245
'The specified threshold parameter (%s) is invalid.'."\n".
244-
'The value must be in percentage or an integer'."\n".
246+
'The value must be an integer or a percentage value'."\n".
245247
'Please refer to ImageMagick command line documentation:'."\n%s",
246-
$threshold, 'http://www.imagemagick.org/script/command-line-options.php#threshold'
248+
$threshold,
249+
'http://www.imagemagick.org/script/command-line-options.php#threshold'
247250
));
248251

249252
}

0 commit comments

Comments
 (0)