Passed
Push — PHP-7.x ( ea2a97...6797f4 )
by Biao
25:55 queued 20:27
created
src/Components/Prometheus/Collectors/HttpRequestCollector.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -21,26 +21,26 @@  discard block
 block discarded – undo
21 21
         if ($routes instanceof \Illuminate\Routing\RouteCollection) { // Laravel
22 22
             foreach ($routes->getRoutes() as $route) {
23 23
                 $method = $route->methods()[0];
24
-                $uri = '/' . ltrim($route->uri(), '/');
25
-                $this->routes[$method . $uri] = $uri;
24
+                $uri = '/'.ltrim($route->uri(), '/');
25
+                $this->routes[$method.$uri] = $uri;
26 26
 
27 27
                 $action = $route->getAction();
28 28
                 if (is_string($action['uses'])) { // Uses
29
-                    $this->routesByUses[$method . $action['uses']] = $uri;
29
+                    $this->routesByUses[$method.$action['uses']] = $uri;
30 30
                 } elseif ($action['uses'] instanceof Closure) {  // Closure
31 31
                     $objectId = spl_object_hash($action['uses']);
32
-                    $this->routesByClosure[$method . $objectId] = $uri;
32
+                    $this->routesByClosure[$method.$objectId] = $uri;
33 33
                 }
34 34
             }
35 35
         } elseif (is_array($routes)) { // Lumen
36 36
             $this->routes = $routes;
37 37
             foreach ($routes as $route) {
38 38
                 if (isset($route['action']['uses'])) { // Uses
39
-                    $this->routesByUses[$route['method'] . $route['action']['uses']] = $route['uri'];
39
+                    $this->routesByUses[$route['method'].$route['action']['uses']] = $route['uri'];
40 40
                 }
41 41
                 if (isset($route['action'][0]) && $route['action'][0] instanceof Closure) { // Closure
42 42
                     $objectId = spl_object_hash($route['action'][0]);
43
-                    $this->routesByClosure[$route['method'] . $objectId] = $route['uri'];
43
+                    $this->routesByClosure[$route['method'].$objectId] = $route['uri'];
44 44
                 }
45 45
             }
46 46
         }
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
         }
64 64
 
65 65
         $uri = $this->findRouteUri($request);
66
-        $cost = (int)round((microtime(true) - $request->server('REQUEST_TIME_FLOAT')) * 1000000); // Time unit: μs
66
+        $cost = (int) round((microtime(true) - $request->server('REQUEST_TIME_FLOAT')) * 1000000); // Time unit: μs
67 67
 
68 68
         // Http Request Stats
69 69
         $requestLabels = http_build_query([
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
     {
103 103
         $method = $request->getMethod();
104 104
         $uri = $request->getPathInfo();
105
-        $key = $method . $uri;
105
+        $key = $method.$uri;
106 106
         if (isset($this->routes[$key])) {
107 107
             return $uri;
108 108
         }
@@ -112,12 +112,12 @@  discard block
 block discarded – undo
112 112
             $uri = $route->uri();
113 113
         } elseif (is_array($route)) { // Lumen
114 114
             if (isset($route[1]['uses'])) {
115
-                $key = $method . $route[1]['uses'];
115
+                $key = $method.$route[1]['uses'];
116 116
                 if (isset($this->routesByUses[$key])) {
117 117
                     $uri = $this->routesByUses[$key];
118 118
                 }
119 119
             } elseif (isset($route[1][0]) && $route[1][0] instanceof Closure) {
120
-                $key = $method . spl_object_hash($route[1][0]);
120
+                $key = $method.spl_object_hash($route[1][0]);
121 121
                 if (isset($this->routesByClosure[$key])) {
122 122
                     $uri = $this->routesByClosure[$key];
123 123
                 }
Please login to merge, or discard this patch.