Skip to content

Commit

Permalink
Make some slight coding style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierstoval committed Jul 31, 2020
1 parent 7bf6939 commit 4954541
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions References.php
Original file line number Diff line number Diff line change
Expand Up @@ -230,20 +230,23 @@ public function threshold(string $threshold): string
{
$threshold = \trim($threshold);

if (is_numeric($threshold)) {
return $threshold;
}

if (substr($threshold, -1) == '%') {
$percent_num = substr($threshold, 0, -1);
if (is_numeric($percent_num)) {
$percentNumber = substr($threshold, 0, -1);
if (is_numeric($percentNumber)) {
return $threshold;
}
} else if (is_numeric($threshold)) {
return $threshold;
}

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

}
Expand Down

0 comments on commit 4954541

Please sign in to comment.