@@ -27,9 +27,9 @@ |
||
| 27 | 27 | ->getMock(); |
| 28 | 28 | |
| 29 | 29 | $this->router |
| 30 | - ->expects($this->once()) |
|
| 31 | - ->method('route') |
|
| 32 | - ->willReturn(['controller' => 'Default', 'action' => 'notFound', 'params' => []]); |
|
| 30 | + ->expects($this->once()) |
|
| 31 | + ->method('route') |
|
| 32 | + ->willReturn(['controller' => 'Default', 'action' => 'notFound', 'params' => []]); |
|
| 33 | 33 | |
| 34 | 34 | $this->app = new Application($this->router); |
| 35 | 35 | } |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | $regex = $this->createRegex($route); |
| 29 | 29 | |
| 30 | 30 | if (preg_match('#^'.$regex.'$#', $path, $matches)) { |
| 31 | - $params = array_filter($matches, function ($key) { |
|
| 31 | + $params = array_filter($matches, function($key) { |
|
| 32 | 32 | return !is_int($key); |
| 33 | 33 | }, ARRAY_FILTER_USE_KEY); |
| 34 | 34 | return [ |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | $reqs = $route->getRequirements(); |
| 47 | 47 | $regex = preg_replace_callback( |
| 48 | 48 | '/{(\w+)}/', |
| 49 | - function ($matches) use ($reqs) { |
|
| 49 | + function($matches) use ($reqs) { |
|
| 50 | 50 | $req = $reqs[$matches[1]] ?? '.+'; |
| 51 | 51 | return "(?<{$matches[1]}>{$req})"; |
| 52 | 52 | }, |
@@ -21,9 +21,9 @@ |
||
| 21 | 21 | $controller = $attributes['controller'].'Controller'; |
| 22 | 22 | $action = $attributes['action'].'Action'; |
| 23 | 23 | |
| 24 | - $namespace = '\\App\\Controller\\'; |
|
| 24 | + $namespace = '\\App\\Controller\\'; |
|
| 25 | 25 | if (!class_exists($namespace.$controller)) { |
| 26 | - $namespace = '\\Lib\\Controller\\'; |
|
| 26 | + $namespace = '\\Lib\\Controller\\'; |
|
| 27 | 27 | } |
| 28 | 28 | $response = ($namespace.$controller)::create()->$action($request, ...$attributes['params']); |
| 29 | 29 | |
@@ -44,7 +44,7 @@ |
||
| 44 | 44 | |
| 45 | 45 | public function testMatchReturnsDefaultNotFound() |
| 46 | 46 | { |
| 47 | - $return= $this->matcher->match('/blogo'); |
|
| 47 | + $return = $this->matcher->match('/blogo'); |
|
| 48 | 48 | |
| 49 | 49 | $this->assertEquals( |
| 50 | 50 | [ |