Passed
Push — master ( b0ffba...d5ae6f )
by Maxime
38s queued 10s
created
src/RouterContainer.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@
 block discarded – undo
70 70
 
71 71
         if (!empty($route->getWhere())) {
72 72
             foreach ($route->getWhere() as $attribute => $where) {
73
-                $path = preg_replace('#{('.$attribute.')}#', '('.$where.')', $path);
73
+                $path = preg_replace('#{(' . $attribute . ')}#', '(' . $where . ')', $path);
74 74
             }
75 75
         }
76 76
         $path = preg_replace("#{([\w]+)}#", '([^/]+)', $path);
Please login to merge, or discard this patch.
examples/index.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@
 block discarded – undo
7 7
 $router = new Router();
8 8
 
9 9
 $router->get('/home/{id}/{foo}', 'home', function ($id) {
10
-   echo 'hi from home ' . $id;
10
+    echo 'hi from home ' . $id;
11 11
 })->where(['id' => '[0-9]+']);
12 12
 
13 13
 $request = \GuzzleHttp\Psr7\ServerRequest::fromGlobals();
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@
 block discarded – undo
6 6
 
7 7
 $router = new Router();
8 8
 
9
-$router->get('/home/{id}/{foo}', 'home', function ($id) {
9
+$router->get('/home/{id}/{foo}', 'home', function($id) {
10 10
    echo 'hi from home ' . $id;
11 11
 })->where(['id' => '[0-9]+']);
12 12
 
Please login to merge, or discard this patch.
src/Route.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -109,7 +109,7 @@
 block discarded – undo
109 109
      */
110 110
     public function generatePath(array $params = []): string
111 111
     {
112
-        return preg_replace_callback('/\{(.*?)\}/', function ($m) use (&$params) {
112
+        return preg_replace_callback('/\{(.*?)\}/', function($m) use (&$params) {
113 113
             if (isset($params[$m[1]])) {
114 114
                 return $params[$m[1]];
115 115
             }
Please login to merge, or discard this patch.