Skip to content

Commit

Permalink
fix broken tests
Browse files Browse the repository at this point in the history
  • Loading branch information
James Galecki committed Mar 6, 2018
1 parent 0babba0 commit 606a22c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Filter/Ints.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,28 +114,28 @@ private static function castAndEnforceValidIntegerSize(string $value) : int
return $casted;
}

private static function enforceMinimumValue(int $minValue, $valueInt)
private static function enforceMinimumValue(int $minValue = null, int $valueInt)
{
if ($minValue !== null && $valueInt < $minValue) {
throw new FilterException("{$valueInt} is less than {$minValue}");
}
}

private static function enforceMaximumValue(int $maxValue, $valueInt)
private static function enforceMaximumValue(int $maxValue = null, int $valueInt)
{
if ($valueInt > $maxValue) {
throw new FilterException("{$valueInt} is greater than {$maxValue}");
}
}

private static function enforcePhpIntMax(string $value, $casted)
private static function enforcePhpIntMax(string $value, int $casted)
{
if ($casted === PHP_INT_MAX && $value !== (string)PHP_INT_MAX) {
throw new FilterException("{$value} was greater than a max int of " . PHP_INT_MAX);
}
}

private static function enforcePhpIntMin(string $value, $casted, $phpIntMin)
private static function enforcePhpIntMin(string $value, int $casted, int $phpIntMin)
{
if ($casted === $phpIntMin && $value !== (string)$phpIntMin) {
throw new FilterException("{$value} was less than a min int of {$phpIntMin}");
Expand Down

0 comments on commit 606a22c

Please sign in to comment.