Passed
Push — master ( 217db8...cecd6f )
by Woody
02:56
created
src/RouteCollection.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Router.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
             }
Please login to merge, or discard this patch.
tests/RouterTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -25,11 +25,11 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
tests/CanMockHandler.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
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
             }
Please login to merge, or discard this patch.