@@ -23,7 +23,7 @@ |
||
| 23 | 23 | */ |
| 24 | 24 | public function get(string $name): Route |
| 25 | 25 | { |
| 26 | - if (! $this->has($name)) { |
|
| 26 | + if (!$this->has($name)) { |
|
| 27 | 27 | throw Error\RouteNotSetException::from($name); |
| 28 | 28 | } |
| 29 | 29 | |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | } |
| 143 | 143 | |
| 144 | 144 | // Check if the parameter can be matched |
| 145 | - if (! preg_match("~^{$part[1]}$~", strval($params[$part[0]]))) { |
|
| 145 | + if (!preg_match("~^{$part[1]}$~", strval($params[$part[0]]))) { |
|
| 146 | 146 | throw Error\UriParameterInvalidException::from($part[0], $part[1]); |
| 147 | 147 | } |
| 148 | 148 | |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | |
| 193 | 193 | private function makeDispatcher(): Dispatcher |
| 194 | 194 | { |
| 195 | - return simpleDispatcher(function (RouteCollector $collector): void { |
|
| 195 | + return simpleDispatcher(function(RouteCollector $collector): void { |
|
| 196 | 196 | foreach ($this->routes as $route) { |
| 197 | 197 | $collector->addRoute($route->method(), $route->pattern(), $route); |
| 198 | 198 | } |
@@ -25,11 +25,11 @@ |
||
| 25 | 25 | |
| 26 | 26 | public function testCanHandleGetRequest(): void |
| 27 | 27 | { |
| 28 | - $this->router->get('users.list', '/users', $this->mockHandler(function ($request) { |
|
| 28 | + $this->router->get('users.list', '/users', $this->mockHandler(function($request) { |
|
| 29 | 29 | return $request->getAttributes() === []; |
| 30 | 30 | })); |
| 31 | 31 | |
| 32 | - $this->router->get('users.detail', '/users/{id}', $this->mockHandler(function ($request) { |
|
| 32 | + $this->router->get('users.detail', '/users/{id}', $this->mockHandler(function($request) { |
|
| 33 | 33 | return $request->getAttribute('id') === '22'; |
| 34 | 34 | })); |
| 35 | 35 | |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | |
| 20 | 20 | public function __construct(?callable $assertion) |
| 21 | 21 | { |
| 22 | - $this->assertion = $assertion ?? function ($request) { |
|
| 22 | + $this->assertion = $assertion ?? function($request) { |
|
| 23 | 23 | return true; |
| 24 | 24 | }; |
| 25 | 25 | } |