@@ -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 |
@@ -57,9 +57,9 @@ discard block |
||
| 57 | 57 | |
| 58 | 58 | $routes = self::getInstance()->getRoutes(); |
| 59 | 59 | $routes[] = [ |
| 60 | - 'uri' => new Uri(self::getInstance()->getHost().self::getInstance()->prefix.$uri), |
|
| 61 | - 'action' => $closure, |
|
| 62 | - 'method' => strtoupper($method), |
|
| 60 | + 'uri' => new Uri(self::getInstance()->getHost().self::getInstance()->prefix.$uri), |
|
| 61 | + 'action' => $closure, |
|
| 62 | + 'method' => strtoupper($method), |
|
| 63 | 63 | 'middlewares' => null, |
| 64 | 64 | 'where' => null, |
| 65 | 65 | 'before' => [], |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | private static function checkDuplicity(string $uri, string $method): void |
| 77 | 77 | { |
| 78 | 78 | foreach(self::getInstance()->getRoutes() as $route){ |
| 79 | - if( md5($route['uri'].$route['method']) === md5($uri.$method) ){ |
|
| 79 | + if( md5($route['uri'].$route['method']) === md5($uri.$method) ){ |
|
| 80 | 80 | throw new \RuntimeException("There is already a route with the URI {$uri} and with the {$method} METHOD configured."); |
| 81 | 81 | } |
| 82 | 82 | } |