Passed
Push — master ( b5d6f6...ea35d6 )
by Biao
03:50
created
src/Components/Prometheus/Collectors/HttpRequestCollector.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -20,26 +20,26 @@  discard block
 block discarded – undo
20 20
         if ($routes instanceof \Illuminate\Routing\RouteCollection) { // Laravel
21 21
             foreach ($routes->getRoutes() as $route) {
22 22
                 $method = $route->methods()[0];
23
-                $uri = '/' . ltrim($route->uri(), '/');
24
-                $this->routes[$method . $uri] = $uri;
23
+                $uri = '/'.ltrim($route->uri(), '/');
24
+                $this->routes[$method.$uri] = $uri;
25 25
 
26 26
                 $action = $route->getAction();
27 27
                 if (is_string($action['uses'])) { // Uses
28
-                    $this->routesByUses[$method . $action['uses']] = $uri;
28
+                    $this->routesByUses[$method.$action['uses']] = $uri;
29 29
                 } elseif ($action['uses'] instanceof Closure) {  // Closure
30 30
                     $objectId = spl_object_hash($action['uses']);
31
-                    $this->routesByClosure[$method . $objectId] = $uri;
31
+                    $this->routesByClosure[$method.$objectId] = $uri;
32 32
                 }
33 33
             }
34 34
         } elseif (is_array($routes)) { // Lumen
35 35
             $this->routes = $routes;
36 36
             foreach ($routes as $route) {
37 37
                 if (isset($route['action']['uses'])) { // Uses
38
-                    $this->routesByUses[$route['method'] . $route['action']['uses']] = $route['uri'];
38
+                    $this->routesByUses[$route['method'].$route['action']['uses']] = $route['uri'];
39 39
                 }
40 40
                 if (isset($route['action'][0]) && $route['action'][0] instanceof Closure) { // Closure
41 41
                     $objectId = spl_object_hash($route['action'][0]);
42
-                    $this->routesByClosure[$route['method'] . $objectId] = $route['uri'];
42
+                    $this->routesByClosure[$route['method'].$objectId] = $route['uri'];
43 43
                 }
44 44
             }
45 45
         }
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
     {
83 83
         $method = $request->getMethod();
84 84
         $uri = $request->getPathInfo();
85
-        $key = $method . $uri;
85
+        $key = $method.$uri;
86 86
         if (isset($this->routes[$key])) {
87 87
             return $uri;
88 88
         }
@@ -92,12 +92,12 @@  discard block
 block discarded – undo
92 92
             $uri = $route->uri();
93 93
         } elseif (is_array($route)) { // Lumen
94 94
             if (isset($route[1]['uses'])) {
95
-                $key = $method . $route[1]['uses'];
95
+                $key = $method.$route[1]['uses'];
96 96
                 if (isset($this->routesByUses[$key])) {
97 97
                     $uri = $this->routesByUses[$key];
98 98
                 }
99 99
             } elseif (isset($route[1][0]) && $route[1][0] instanceof Closure) {
100
-                $key = $method . spl_object_hash($route[1][0]);
100
+                $key = $method.spl_object_hash($route[1][0]);
101 101
                 if (isset($this->routesByClosure[$key])) {
102 102
                     $uri = $this->routesByClosure[$key];
103 103
                 }
Please login to merge, or discard this patch.