@@ -104,11 +104,11 @@ discard block |
||
104 | 104 | $found = false; |
105 | 105 | $counter = 0; |
106 | 106 | |
107 | - if(count($this->routes) === 0) { |
|
107 | + if (count($this->routes) === 0) { |
|
108 | 108 | return $found; |
109 | 109 | } |
110 | 110 | |
111 | - while($found === false && $counter < count($this->routes)) { |
|
111 | + while ($found === false && $counter < count($this->routes)) { |
|
112 | 112 | if ($this->routes[$counter]->getUri() === $uri && $this->routes[$counter]->getMethod() === $method) { |
113 | 113 | $found = true; |
114 | 114 | } |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | */ |
130 | 130 | |
131 | 131 | private function addOrder($uri, $method, $response, array $middleware = []) { |
132 | - if($this->find($uri, $method)) { // search if exists an apparition |
|
132 | + if ($this->find($uri, $method)) { // search if exists an apparition |
|
133 | 133 | return false; |
134 | 134 | } |
135 | 135 | |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | */ |
208 | 208 | |
209 | 209 | public function notFound($func) { |
210 | - if(is_callable($func)) { |
|
210 | + if (is_callable($func)) { |
|
211 | 211 | $this->notFound = $func; |
212 | 212 | } |
213 | 213 | } |
@@ -225,17 +225,17 @@ discard block |
||
225 | 225 | public function run() { |
226 | 226 | $found = false; |
227 | 227 | $counter = 0; |
228 | - while($found === false && $counter < count($this->routes)) { |
|
229 | - if($this->routerParser->match($this->routes[$counter]->getUri()) && $this->routes[$counter]->getMethod() === $this->requestMethod) { |
|
228 | + while ($found === false && $counter < count($this->routes)) { |
|
229 | + if ($this->routerParser->match($this->routes[$counter]->getUri()) && $this->routes[$counter]->getMethod() === $this->requestMethod) { |
|
230 | 230 | $found = true; |
231 | 231 | } else { |
232 | 232 | $counter++; |
233 | 233 | } |
234 | 234 | } |
235 | 235 | |
236 | - if($found) { |
|
236 | + if ($found) { |
|
237 | 237 | // run the before middleware if it exists |
238 | - if($this->routes[$counter]->hasBefore()) { |
|
238 | + if ($this->routes[$counter]->hasBefore()) { |
|
239 | 239 | call_user_func($this->routes[$counter]->getMiddlewares()['before']); |
240 | 240 | } |
241 | 241 | |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | $response = call_user_func_array($this->routes[$counter]->getResponse(), $params); |
244 | 244 | |
245 | 245 | // run the after middleware if it exists |
246 | - if($this->routes[$counter]->hasAfter()) { |
|
246 | + if ($this->routes[$counter]->hasAfter()) { |
|
247 | 247 | call_user_func($this->routes[$counter]->getMiddlewares()['after']); |
248 | 248 | } |
249 | 249 |