Completed
Push — 4.0 ( 0c3d7c...75a76e )
by Marco
12:24
created
src/Comodojo/Dispatcher/Components/Parameters.php 1 patch
Braces   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -28,16 +28,16 @@
 block discarded – undo
28 28
 
29 29
     final public function get($parameter=null) {
30 30
 
31
-        if ( is_null($parameter) ) return $this->parameters;
32
-
33
-        else if ( array_key_exists($parameter, $this->parameters) ) {
31
+        if ( is_null($parameter) ) {
32
+            return $this->parameters;
33
+        } else if ( array_key_exists($parameter, $this->parameters) ) {
34 34
 
35 35
             return $this->parameters[$parameter];
36 36
 
37
+        } else {
38
+            return null;
37 39
         }
38 40
 
39
-        else return null;
40
-
41 41
     }
42 42
 
43 43
     final public function set($parameter, $value) {
Please login to merge, or discard this patch.
src/Comodojo/Dispatcher/Request/Headers.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,9 @@
 block discarded – undo
41 41
      */
42 42
     private static function getHeaders() {
43 43
 
44
-        if ( function_exists('getallheaders') ) return getallheaders();
44
+        if ( function_exists('getallheaders') ) {
45
+            return getallheaders();
46
+        }
45 47
 
46 48
         $headers = array();
47 49
 
Please login to merge, or discard this patch.
src/Comodojo/Dispatcher/Service/AbstractService.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -104,7 +104,9 @@
 block discarded – undo
104 104
 
105 105
         foreach ( $supported_methods as $method ) {
106 106
 
107
-            if ( method_exists($this, strtolower($method)) ) array_push($implemented_methods,$method);
107
+            if ( method_exists($this, strtolower($method)) ) {
108
+                array_push($implemented_methods,$method);
109
+            }
108 110
 
109 111
         }
110 112
 
Please login to merge, or discard this patch.
src/Comodojo/Dispatcher/Components/Headers.php 1 patch
Braces   +10 added lines, -6 removed lines patch added patch discarded remove patch
@@ -29,11 +29,13 @@  discard block
 block discarded – undo
29 29
 
30 30
     public function get($header = null) {
31 31
 
32
-        if ( is_null($header) ) return $this->headers;
33
-
34
-        else if ( array_key_exists($header, $this->headers) ) return $this->headers[$header];
35
-
36
-        else return null;
32
+        if ( is_null($header) ) {
33
+            return $this->headers;
34
+        } else if ( array_key_exists($header, $this->headers) ) {
35
+            return $this->headers[$header];
36
+        } else {
37
+            return null;
38
+        }
37 39
 
38 40
     }
39 41
 
@@ -50,7 +52,9 @@  discard block
 block discarded – undo
50 52
 
51 53
             return (string)($header.':'.$this->headers[$header]);
52 54
 
53
-        } else return null;
55
+        } else {
56
+            return null;
57
+        }
54 58
 
55 59
     }
56 60
 
Please login to merge, or discard this patch.
src/Comodojo/Dispatcher/Components/Timestamp.php 1 patch
Braces   +5 added lines, -3 removed lines patch added patch discarded remove patch
@@ -35,9 +35,11 @@
 block discarded – undo
35 35
 
36 36
     final public function setTimestamp($time = null) {
37 37
 
38
-        if ( is_float($time) ) $this->timestamp = $time;
39
-
40
-        else $this->timestamp = microtime(true);
38
+        if ( is_float($time) ) {
39
+            $this->timestamp = $time;
40
+        } else {
41
+            $this->timestamp = microtime(true);
42
+        }
41 43
 
42 44
         return $this;
43 45
 
Please login to merge, or discard this patch.
src/Comodojo/Dispatcher/Log/DispatcherLogger.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -63,7 +63,9 @@
 block discarded – undo
63 63
 
64 64
                 $handler = $this->getHandler($provider, $parameters);
65 65
 
66
-                if ( $handler instanceof HandlerInterface ) $logger->pushHandler($handler);
66
+                if ( $handler instanceof HandlerInterface ) {
67
+                    $logger->pushHandler($handler);
68
+                }
67 69
 
68 70
             }
69 71
 
Please login to merge, or discard this patch.
src/Comodojo/Dispatcher/Cache/DispatcherCache.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -64,7 +64,9 @@
 block discarded – undo
64 64
 
65 65
                     $handler = $this->getHandler($provider, $parameters);
66 66
 
67
-                    if ( $handler instanceof CacheInterface ) $manager->addProvider($handler);
67
+                    if ( $handler instanceof CacheInterface ) {
68
+                        $manager->addProvider($handler);
69
+                    }
68 70
 
69 71
                 }
70 72
 
Please login to merge, or discard this patch.
src/Comodojo/Dispatcher/Router/Collector.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -113,8 +113,9 @@  discard block
 block discarded – undo
113 113
                 $this->extra
114 114
             );
115 115
 
116
+        } else {
117
+            return null;
116 118
         }
117
-        else return null;
118 119
 
119 120
     }
120 121
 
@@ -294,7 +295,10 @@  discard block
 block discarded – undo
294 295
                  */
295 296
                 if (preg_match('/^' . $value['regex'] . '$/', $bits[$key], $matches)) {
296 297
                     
297
-                    if (count($matches) == 1) $matches = $matches[0]; // This is the case where no backreferences are present or available.
298
+                    if (count($matches) == 1) {
299
+                        $matches = $matches[0];
300
+                    }
301
+                    // This is the case where no backreferences are present or available.
298 302
                     
299 303
                     // The extracted value (with any backreference available) is added to the query parameters.
300 304
                     $this->request->query()->set($key, $matches);
Please login to merge, or discard this patch.
src/Comodojo/Dispatcher/Router/RoutingTable.php 1 patch
Braces   +11 added lines, -6 removed lines patch added patch discarded remove patch
@@ -70,10 +70,11 @@  discard block
 block discarded – undo
70 70
 
71 71
         $regex = $this->readpath($folders);
72 72
 
73
-        if (isset($this->routes[$regex]))
74
-            return $this->routes[$regex];
75
-        else
76
-            return null;
73
+        if (isset($this->routes[$regex])) {
74
+                    return $this->routes[$regex];
75
+        } else {
76
+                    return null;
77
+        }
77 78
 
78 79
     }
79 80
 
@@ -83,7 +84,9 @@  discard block
 block discarded – undo
83 84
 
84 85
         $regex = $this->readpath($folders);
85 86
 
86
-        if (isset($this->routes[$regex])) unset($this->routes[$regex]);
87
+        if (isset($this->routes[$regex])) {
88
+            unset($this->routes[$regex]);
89
+        }
87 90
 
88 91
     }
89 92
 
@@ -164,7 +167,9 @@  discard block
 block discarded – undo
164 167
 
165 168
             } else {
166 169
                 // if the element is not a json string, I assume it's the service name
167
-                if (!isset($value['service'])) $value['service'] = array();
170
+                if (!isset($value['service'])) {
171
+                    $value['service'] = array();
172
+                }
168 173
                 array_push($value['service'], $folder);
169 174
 
170 175
                 return $this->readpath(
Please login to merge, or discard this patch.