@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | self::getInstance()->checkMethod($route, $_SERVER['REQUEST_METHOD']); |
| 80 | 80 | self::getInstance()->checkData($route, (new Uri($_SERVER['REQUEST_URI']))->getPath()); |
| 81 | 81 | return self::getInstance(); |
| 82 | - }catch(\Exception $er){ |
|
| 82 | + } catch(\Exception $er){ |
|
| 83 | 83 | continue; |
| 84 | 84 | } |
| 85 | 85 | } |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | |
| 99 | 99 | try{ |
| 100 | 100 | self::getInstance()->executeRouteAction(); |
| 101 | - }catch(\Exception $er){ |
|
| 101 | + } catch(\Exception $er){ |
|
| 102 | 102 | self::getInstance()->error = $er; |
| 103 | 103 | } |
| 104 | 104 | |
@@ -57,10 +57,10 @@ discard block |
||
| 57 | 57 | |
| 58 | 58 | self::checkDuplicity($uri,$method); |
| 59 | 59 | |
| 60 | - self::getInstance()->routes[] = [ |
|
| 61 | - 'uri' => new Uri(self::getInstance()->host.self::getInstance()->prefix.$uri), |
|
| 62 | - 'action' => $closure, |
|
| 63 | - 'method' => strtoupper($method), |
|
| 60 | + self::getInstance()->routes[] = [ |
|
| 61 | + 'uri' => new Uri(self::getInstance()->host.self::getInstance()->prefix.$uri), |
|
| 62 | + 'action' => $closure, |
|
| 63 | + 'method' => strtoupper($method), |
|
| 64 | 64 | 'middlewares' => null, |
| 65 | 65 | 'where' => null, |
| 66 | 66 | 'before' => [], |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | private static function checkDuplicity(string $uri, string $method): void |
| 76 | 76 | { |
| 77 | 77 | foreach(self::getInstance()->routes as $route){ |
| 78 | - if( md5($route['uri'].$route['method']) === md5($uri.$method) ){ |
|
| 78 | + if( md5($route['uri'].$route['method']) === md5($uri.$method) ){ |
|
| 79 | 79 | throw new \RuntimeException("There is already a route with the URI {$uri} and with the {$method} METHOD configured."); |
| 80 | 80 | } |
| 81 | 81 | } |