| @@ 37-39 (lines=3) @@ | ||
| 34 | */ |
|
| 35 | public static function filter($value, $allowNull = false, $minValue = null, $maxValue = null, $castInts = false) |
|
| 36 | { |
|
| 37 | if ($allowNull !== false && $allowNull !== true) { |
|
| 38 | throw new \InvalidArgumentException('"' . var_export($allowNull, true) . '" $allowNull was not a bool'); |
|
| 39 | } |
|
| 40 | ||
| 41 | if ($minValue !== null && !is_float($minValue)) { |
|
| 42 | throw new \InvalidArgumentException('"' . var_export($minValue, true) . '" $minValue was not a float'); |
|
| @@ 49-51 (lines=3) @@ | ||
| 46 | throw new \InvalidArgumentException('"' . var_export($maxValue, true) . '" $maxValue was not a float'); |
|
| 47 | } |
|
| 48 | ||
| 49 | if ($castInts !== false && $castInts !== true) { |
|
| 50 | throw new \InvalidArgumentException('"' . var_export($castInts, true) . '" $castInts was not a bool'); |
|
| 51 | } |
|
| 52 | ||
| 53 | if ($allowNull === true && $value === null) { |
|
| 54 | return null; |
|
| @@ 39-41 (lines=3) @@ | ||
| 36 | */ |
|
| 37 | public static function filter($value, $allowNull = false, $minValue = null, $maxValue = PHP_INT_MAX) |
|
| 38 | { |
|
| 39 | if ($allowNull !== false && $allowNull !== true) { |
|
| 40 | throw new \InvalidArgumentException('"' . var_export($allowNull, true) . '" $allowNull was not a bool'); |
|
| 41 | } |
|
| 42 | ||
| 43 | if ($minValue !== null && !is_int($minValue)) { |
|
| 44 | throw new \InvalidArgumentException('"' . var_export($minValue, true) . '" $minValue was not an int'); |
|