@@ -36,8 +36,8 @@ discard block |
||
36 | 36 | */ |
37 | 37 | public static function intBetween(int $minimum, int $maximum): \Closure |
38 | 38 | { |
39 | - if ($maximum <= $minimum) |
|
40 | - throw new \InvalidArgumentException('Maximum can not be lesser than or equal to minimum.'); |
|
39 | + if ($maximum <= $minimum) |
|
40 | + throw new \InvalidArgumentException('Maximum can not be lesser than or equal to minimum.'); |
|
41 | 41 | |
42 | 42 | return function ($value) use ($minimum, $maximum) |
43 | 43 | { |
@@ -53,13 +53,13 @@ discard block |
||
53 | 53 | */ |
54 | 54 | public static function intBetweenExclusive(int $minimum, int $maximum): \Closure |
55 | 55 | { |
56 | - if ($maximum <= $minimum) |
|
57 | - throw new \InvalidArgumentException('Maximum can not be lesser than or equal to minimum.'); |
|
56 | + if ($maximum <= $minimum) |
|
57 | + throw new \InvalidArgumentException('Maximum can not be lesser than or equal to minimum.'); |
|
58 | 58 | |
59 | - return function ($value) use ($minimum, $maximum) |
|
60 | - { |
|
61 | - return Types::int()($value) && ($value > $minimum && $value < $maximum); |
|
62 | - }; |
|
59 | + return function ($value) use ($minimum, $maximum) |
|
60 | + { |
|
61 | + return Types::int()($value) && ($value > $minimum && $value < $maximum); |
|
62 | + }; |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | /** |
@@ -70,8 +70,8 @@ discard block |
||
70 | 70 | */ |
71 | 71 | public static function floatBetween(float $minimum, float $maximum): \Closure |
72 | 72 | { |
73 | - if ($maximum <= $minimum) |
|
74 | - throw new \InvalidArgumentException('Maximum can not be lesser than or equal to minimum.'); |
|
73 | + if ($maximum <= $minimum) |
|
74 | + throw new \InvalidArgumentException('Maximum can not be lesser than or equal to minimum.'); |
|
75 | 75 | |
76 | 76 | return function ($value) use ($minimum, $maximum) |
77 | 77 | { |
@@ -87,13 +87,13 @@ discard block |
||
87 | 87 | */ |
88 | 88 | public static function floatBetweenExclusive(float $minimum, float $maximum): \Closure |
89 | 89 | { |
90 | - if ($maximum <= $minimum) |
|
91 | - throw new \InvalidArgumentException('Maximum can not be lesser than or equal to minimum.'); |
|
90 | + if ($maximum <= $minimum) |
|
91 | + throw new \InvalidArgumentException('Maximum can not be lesser than or equal to minimum.'); |
|
92 | 92 | |
93 | - return function ($value) use ($minimum, $maximum) |
|
94 | - { |
|
95 | - return Types::float()($value) && ($value > $minimum && $value < $maximum); |
|
96 | - }; |
|
93 | + return function ($value) use ($minimum, $maximum) |
|
94 | + { |
|
95 | + return Types::float()($value) && ($value > $minimum && $value < $maximum); |
|
96 | + }; |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | /** |
@@ -73,13 +73,13 @@ |
||
73 | 73 | */ |
74 | 74 | public static function createClosureFromCallable(callable $callable) |
75 | 75 | { |
76 | - // Closure::fromCallable was introduced in PHP 7.1.0 |
|
77 | - if (version_compare(PHP_VERSION, '7.1.0', '>=')) |
|
78 | - return \Closure::fromCallable($callable); |
|
76 | + // Closure::fromCallable was introduced in PHP 7.1.0 |
|
77 | + if (version_compare(PHP_VERSION, '7.1.0', '>=')) |
|
78 | + return \Closure::fromCallable($callable); |
|
79 | 79 | |
80 | - return function ($value) use ($callable) |
|
81 | - { |
|
82 | - return $callable($value); |
|
83 | - }; |
|
80 | + return function ($value) use ($callable) |
|
81 | + { |
|
82 | + return $callable($value); |
|
83 | + }; |
|
84 | 84 | } |
85 | 85 | } |
86 | 86 | \ No newline at end of file |
@@ -71,7 +71,7 @@ |
||
71 | 71 | */ |
72 | 72 | public static function numeric(): \Closure |
73 | 73 | { |
74 | - return Utils::createClosureFromCallable('is_numeric'); |
|
74 | + return Utils::createClosureFromCallable('is_numeric'); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | /** |