Completed
Push — 4.0 ( 7ee5d6...ad8a54 )
by Marco
02:43
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/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/Router/Route.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/Parser.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -103,7 +103,9 @@
 block discarded – undo
103 103
                      */
104 104
                     $param_regex .= $this->param($key, $string, $value);
105 105
                     
106
-                    if ($value->isQueryRequired($key)) $param_required = true;
106
+                    if ($value->isQueryRequired($key)) {
107
+                        $param_required = true;
108
+                    }
107 109
 
108 110
                     $this->logger->debug("PARAMETER REGEX: " . $param_regex);
109 111
 
Please login to merge, or discard this patch.
src/Comodojo/Dispatcher/Router/Model.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
         if (!$this->bypass) {
106 106
             
107
-            if (!$this->parse()) throw new DispatcherException("Unable to find a valid route for the specified uri", 0, null, 404);
107
+            if (!$this->parse()) {
108
+                throw new DispatcherException("Unable to find a valid route for the specified uri", 0, null, 404);
109
+            }
108 110
 
109 111
         }
110 112
         
Please login to merge, or discard this patch.
src/Comodojo/Dispatcher/Components/CacheManager.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/Components/EventsManager.php 1 patch
Braces   +11 added lines, -4 removed lines patch added patch discarded remove patch
@@ -47,7 +47,9 @@  discard block
 block discarded – undo
47 47
 
48 48
         $callable = $this->convertToListener($class, $event);
49 49
 
50
-        if ( $callable === false ) return null;
50
+        if ( $callable === false ) {
51
+            return null;
52
+        }
51 53
 
52 54
         return $this->addListener($event, $callable, $priority);
53 55
 
@@ -57,7 +59,9 @@  discard block
 block discarded – undo
57 59
 
58 60
         $callable = $this->convertToListener($class, $event);
59 61
 
60
-        if ( $callable === false ) return null;
62
+        if ( $callable === false ) {
63
+            return null;
64
+        }
61 65
 
62 66
         return $this->addOneTimeListener($event, $callable, $priority);
63 67
 
@@ -106,8 +110,11 @@  discard block
 block discarded – undo
106 110
                 $priority = isset($plugin['priority']) ? $plugin['priority'] : 0;
107 111
                 $onetime = isset($plugin['onetime']) ? $plugin['onetime'] : 0;
108 112
 
109
-                if ( $onetime ) $this->subscribeOnce($plugin['event'], $plugin['class'], $priority);
110
-                else $this->subscribe($plugin['event'], $plugin['class'], $priority);
113
+                if ( $onetime ) {
114
+                    $this->subscribeOnce($plugin['event'], $plugin['class'], $priority);
115
+                } else {
116
+                    $this->subscribe($plugin['event'], $plugin['class'], $priority);
117
+                }
111 118
 
112 119
             }
113 120
 
Please login to merge, or discard this patch.