@@ -414,7 +414,7 @@ discard block |
||
414 | 414 | |
415 | 415 | // check if route is defined without regex |
416 | 416 | if (in_array($uri, $routes)) { |
417 | - $currentRoute = array_filter($this->routes, function ($r) use ($method, $uri) { |
|
417 | + $currentRoute = array_filter($this->routes, function($r) use ($method, $uri) { |
|
418 | 418 | return RouterRequest::validMethod($r['method'], $method) && $r['route'] === $uri; |
419 | 419 | }); |
420 | 420 | if (!empty($currentRoute)) { |
@@ -438,7 +438,7 @@ discard block |
||
438 | 438 | $this->runRouteMiddleware($data, 'before'); |
439 | 439 | |
440 | 440 | array_shift($matched); |
441 | - $matched = array_map(function ($value) { |
|
441 | + $matched = array_map(function($value) { |
|
442 | 442 | return trim(urldecode($value)); |
443 | 443 | }, $matched); |
444 | 444 | |
@@ -457,7 +457,7 @@ discard block |
||
457 | 457 | |
458 | 458 | if ($foundRoute === false) { |
459 | 459 | if (!$this->errorCallback) { |
460 | - $this->errorCallback = function () { |
|
460 | + $this->errorCallback = function() { |
|
461 | 461 | header($_SERVER['SERVER_PROTOCOL'] . ' 404 Not Found'); |
462 | 462 | return $this->exception('Route not found. Looks like something went wrong. Please try again.'); |
463 | 463 | }; |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | */ |
99 | 99 | public function beforeAfter($command) |
100 | 100 | { |
101 | - if (! is_null($command)) { |
|
101 | + if (!is_null($command)) { |
|
102 | 102 | $info = $this->getMiddlewareInfo(); |
103 | 103 | if (is_array($command)) { |
104 | 104 | foreach ($command as $value) { |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | return $response; |
122 | 122 | } |
123 | 123 | |
124 | - return $this->exception('handle() method is not found in <b>'.$command.'</b> class.'); |
|
124 | + return $this->exception('handle() method is not found in <b>' . $command . '</b> class.'); |
|
125 | 125 | } |
126 | 126 | } |
127 | 127 | |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | public function runRoute($command, $params = null) |
141 | 141 | { |
142 | 142 | $info = $this->getControllerInfo(); |
143 | - if (! is_object($command)) { |
|
143 | + if (!is_object($command)) { |
|
144 | 144 | $segments = explode('@', $command); |
145 | 145 | $controllerClass = str_replace([$info['namespace'], '\\', '.'], ['', '/', '/'], $segments[0]); |
146 | 146 | $controllerMethod = $segments[1]; |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | return; |
152 | 152 | } |
153 | 153 | |
154 | - return $this->exception($controllerMethod . ' method is not found in '.$controllerClass.' class.'); |
|
154 | + return $this->exception($controllerMethod . ' method is not found in ' . $controllerClass . ' class.'); |
|
155 | 155 | } else { |
156 | 156 | echo $this->runMethodWithParams($command, $params); |
157 | 157 | } |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | protected function resolveClass($class, $path, $namespace) |
173 | 173 | { |
174 | 174 | $file = realpath(rtrim($path, '/') . '/' . $class . '.php'); |
175 | - if (! file_exists($file)) { |
|
175 | + if (!file_exists($file)) { |
|
176 | 176 | return $this->exception($class . ' class is not found. Please, check file.'); |
177 | 177 | } |
178 | 178 |
@@ -70,7 +70,7 @@ |
||
70 | 70 | if (isset($headers['X-HTTP-Method-Override']) && |
71 | 71 | in_array($headers['X-HTTP-Method-Override'], ['PUT', 'DELETE', 'PATCH', 'OPTIONS', 'HEAD'])) { |
72 | 72 | $method = $headers['X-HTTP-Method-Override']; |
73 | - } elseif (! empty($_POST['_method'])) { |
|
73 | + } elseif (!empty($_POST['_method'])) { |
|
74 | 74 | $method = strtoupper($_POST['_method']); |
75 | 75 | } |
76 | 76 | } |