@@ -8,8 +8,8 @@ |
||
| 8 | 8 | use Psr\Http\Server\RequestHandlerInterface; |
| 9 | 9 | |
| 10 | 10 | /** |
| 11 | - * @property string $error |
|
| 12 | - */ |
|
| 11 | + * @property string $error |
|
| 12 | + */ |
|
| 13 | 13 | class Lasted extends Middleware{ |
| 14 | 14 | |
| 15 | 15 | public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface |
@@ -7,8 +7,8 @@ |
||
| 7 | 7 | use Psr\Http\Server\RequestHandlerInterface; |
| 8 | 8 | |
| 9 | 9 | /** |
| 10 | - * @property string $error |
|
| 11 | - */ |
|
| 10 | + * @property string $error |
|
| 11 | + */ |
|
| 12 | 12 | class Auth extends Middleware{ |
| 13 | 13 | |
| 14 | 14 | public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface |
@@ -66,9 +66,9 @@ discard block |
||
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | $routes[$index] = [ |
| 69 | - 'uri' => new Uri(self::getInstance()->getHost().self::getInstance()->getPrefix().$uri), |
|
| 70 | - 'action' => $closure, |
|
| 71 | - 'method' => strtoupper($method), |
|
| 69 | + 'uri' => new Uri(self::getInstance()->getHost().self::getInstance()->getPrefix().$uri), |
|
| 70 | + 'action' => $closure, |
|
| 71 | + 'method' => strtoupper($method), |
|
| 72 | 72 | 'middlewares' => [], |
| 73 | 73 | 'where' => [], |
| 74 | 74 | 'before' => [], |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | private static function checkDuplicity(string $uri, string $method): void |
| 87 | 87 | { |
| 88 | 88 | foreach(self::getInstance()->getRoutes() as $route){ |
| 89 | - if( md5($route['uri'].$route['method']) === md5($uri.$method) ){ |
|
| 89 | + if( md5($route['uri'].$route['method']) === md5($uri.$method) ){ |
|
| 90 | 90 | throw new \RuntimeException("There is already a route with the URI {$uri} and with the {$method} METHOD configured."); |
| 91 | 91 | } |
| 92 | 92 | } |