Completed
Pull Request — master (#1)
by
unknown
01:53
created
tests/Filter/IntsTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
             '999999999999' => '9223372036854775808',
135 135
             '170141183460469231731687303715884105727' => '170141183460469231731687303715884105728',
136 136
         ];
137
-        $oneOverMax = $maxes[(string)PHP_INT_MAX];
137
+        $oneOverMax = $maxes[(string) PHP_INT_MAX];
138 138
         Ints::filter($oneOverMax);
139 139
     }
140 140
 
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
             '-9223372036854775808' => '-9223372036854775809',
152 152
             '-170141183460469231731687303715884105728' => '-170141183460469231731687303715884105729',
153 153
         ];
154
-        $oneUnderMin = $mins[(string)~PHP_INT_MAX];
154
+        $oneUnderMin = $mins[(string) ~PHP_INT_MAX];
155 155
         Ints::filter($oneUnderMin);
156 156
     }
157 157
 
Please login to merge, or discard this patch.
src/Filter/Ints.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
             return self::handleStringValues($value);
67 67
         }
68 68
 
69
-        throw new FilterException('"' . var_export($value, true) . '" $value is not a string');
69
+        throw new FilterException('"'.var_export($value, true).'" $value is not a string');
70 70
     }
71 71
 
72 72
     private static function handleStringValues(string $value) : int
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
     private static function castAndEnforceValidIntegerSize(string $value) : int
107 107
     {
108 108
         $phpIntMin = ~PHP_INT_MAX;
109
-        $casted = (int)$value;
109
+        $casted = (int) $value;
110 110
 
111 111
         self::enforcePhpIntMax($value, $casted);
112 112
         self::enforcePhpIntMin($value, $casted, $phpIntMin);
@@ -130,14 +130,14 @@  discard block
 block discarded – undo
130 130
 
131 131
     private static function enforcePhpIntMax(string $value, int $casted)
132 132
     {
133
-        if ($casted === PHP_INT_MAX && $value !== (string)PHP_INT_MAX) {
134
-            throw new FilterException("{$value} was greater than a max int of " . PHP_INT_MAX);
133
+        if ($casted === PHP_INT_MAX && $value !== (string) PHP_INT_MAX) {
134
+            throw new FilterException("{$value} was greater than a max int of ".PHP_INT_MAX);
135 135
         }
136 136
     }
137 137
 
138 138
     private static function enforcePhpIntMin(string $value, int $casted, int $phpIntMin)
139 139
     {
140
-        if ($casted === $phpIntMin && $value !== (string)$phpIntMin) {
140
+        if ($casted === $phpIntMin && $value !== (string) $phpIntMin) {
141 141
             throw new FilterException("{$value} was less than a min int of {$phpIntMin}");
142 142
         }
143 143
     }
Please login to merge, or discard this patch.