@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | { |
210 | 210 | $lines = file($filename, FILE_IGNORE_NEW_LINES); |
211 | 211 | |
212 | - if(!$lines) { |
|
212 | + if (!$lines) { |
|
213 | 213 | return []; |
214 | 214 | } |
215 | 215 | |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | */ |
228 | 228 | public function fileName(string $path): string |
229 | 229 | { |
230 | - return (string)pathinfo($path, PATHINFO_FILENAME); |
|
230 | + return (string) pathinfo($path, PATHINFO_FILENAME); |
|
231 | 231 | } |
232 | 232 | |
233 | 233 | /** |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | */ |
238 | 238 | public function extension(string $path): string |
239 | 239 | { |
240 | - return (string)pathinfo($path, PATHINFO_EXTENSION); |
|
240 | + return (string) pathinfo($path, PATHINFO_EXTENSION); |
|
241 | 241 | } |
242 | 242 | |
243 | 243 | /** |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | $this->findPatternMatches($uri); |
101 | 101 | |
102 | 102 | if (!count($this->matchedRoutes)) { |
103 | - stop(function () { |
|
103 | + stop(function() { |
|
104 | 104 | $this->handleNotFound(); |
105 | 105 | }); |
106 | 106 | } |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | { |
156 | 156 | $routeInfo = []; |
157 | 157 | |
158 | - array_walk($currentRoute, function ($value, $key) use (&$routeInfo) { |
|
158 | + array_walk($currentRoute, function($value, $key) use (&$routeInfo) { |
|
159 | 159 | $routeInfo[ucfirst($key)] = json_encode($value); |
160 | 160 | }); |
161 | 161 | |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | $routePattern = '(\/)?'; |
200 | 200 | $routeParams = []; |
201 | 201 | |
202 | - $lastIndex = (int)array_key_last($routeSegments); |
|
202 | + $lastIndex = (int) array_key_last($routeSegments); |
|
203 | 203 | |
204 | 204 | foreach ($routeSegments as $index => $segment) { |
205 | 205 | $segmentParam = $this->checkSegment($segment, $index, $lastIndex); |
@@ -82,7 +82,7 @@ |
||
82 | 82 | if (!empty($value)) { |
83 | 83 | $captcha = CaptchaManager::getHandler(); |
84 | 84 | |
85 | - if (!$captcha->verify($value)){ |
|
85 | + if (!$captcha->verify($value)) { |
|
86 | 86 | $this->addError($field, 'captcha', $param); |
87 | 87 | } |
88 | 88 | } |
@@ -124,8 +124,9 @@ |
||
124 | 124 | */ |
125 | 125 | public function verify(string $code): bool |
126 | 126 | { |
127 | - if (is_null($this->secretKey)) |
|
128 | - throw new Exception('The secret key is not set'); |
|
127 | + if (is_null($this->secretKey)) { |
|
128 | + throw new Exception('The secret key is not set'); |
|
129 | + } |
|
129 | 130 | |
130 | 131 | if (empty($code)) { |
131 | 132 | $this->errorCodes = ['internal-empty-response']; |