Completed
Push — 4.0 ( 4201d3...101cc9 )
by Marco
06:23
created
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/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/Response/Preprocessor/Status301.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,9 @@
 block discarded – undo
32 32
 
33 33
         $location = $this->response()->location()->get();
34 34
 
35
-        if ( empty($location) ) throw new Exception("Invalid location, cannot redirect");
35
+        if ( empty($location) ) {
36
+            throw new Exception("Invalid location, cannot redirect");
37
+        }
36 38
 
37 39
         $this->response()->headers()->set("Location: ".$location);
38 40
 
Please login to merge, or discard this patch.
src/Comodojo/Dispatcher/Response/Preprocessor/Status405.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,9 @@
 block discarded – undo
33 33
         // An Allow Header should be provided from DispatcherException
34 34
         $allow = $this->response()->headers()->get('Allow');
35 35
 
36
-        if ( is_null($allow) ) throw new Exception("Missing Allow header");
36
+        if ( is_null($allow) ) {
37
+            throw new Exception("Missing Allow header");
38
+        }
37 39
 
38 40
         parent::consolidate();
39 41
 
Please login to merge, or discard this patch.
src/Comodojo/Dispatcher/Service/AbstractService.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -96,7 +96,9 @@  discard block
 block discarded – undo
96 96
 
97 97
         $supported_methods = $this->configuration()->get('supported-http-methods');
98 98
 
99
-        if ( is_null($supported_methods) ) $supported_methods = array('GET','PUT','POST','DELETE','OPTIONS','HEAD','TRACE','CONNECT','PURGE');
99
+        if ( is_null($supported_methods) ) {
100
+            $supported_methods = array('GET','PUT','POST','DELETE','OPTIONS','HEAD','TRACE','CONNECT','PURGE');
101
+        }
100 102
 
101 103
         if ( method_exists($this, 'any') ) {
102 104
 
@@ -108,7 +110,9 @@  discard block
 block discarded – undo
108 110
 
109 111
         foreach ( $supported_methods as $method ) {
110 112
 
111
-            if ( method_exists($this, strtolower($method)) ) array_push($implemented_methods,$method);
113
+            if ( method_exists($this, strtolower($method)) ) {
114
+                array_push($implemented_methods,$method);
115
+            }
112 116
 
113 117
         }
114 118
 
Please login to merge, or discard this patch.
src/Comodojo/Dispatcher/Router/Model.php 1 patch
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -105,7 +105,9 @@  discard block
 block discarded – undo
105 105
 
106 106
         if (!$this->bypass_routing) {
107 107
 
108
-            if (!$this->parse()) throw new DispatcherException("Unable to find a valid route for the specified uri", 0, null, 404);
108
+            if (!$this->parse()) {
109
+                throw new DispatcherException("Unable to find a valid route for the specified uri", 0, null, 404);
110
+            }
109 111
 
110 112
         }
111 113
 
@@ -133,8 +135,9 @@  discard block
 block discarded – undo
133 135
                 $this->extra
134 136
             );
135 137
 
138
+        } else {
139
+            return null;
136 140
         }
137
-        else return null;
138 141
         
139 142
     }
140 143
 
Please login to merge, or discard this patch.
src/Comodojo/Dispatcher/Router/Route.php 1 patch
Braces   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -223,7 +223,10 @@
 block discarded – undo
223 223
                  */
224 224
                 if (preg_match('/^' . $value['regex'] . '$/', $bits[$key], $matches)) {
225 225
                     
226
-                    if (count($matches) == 1) $matches = $matches[0]; // This is the case where no backreferences are present or available.
226
+                    if (count($matches) == 1) {
227
+                        $matches = $matches[0];
228
+                    }
229
+                    // This is the case where no backreferences are present or available.
227 230
                     
228 231
                     // The extracted value (with any backreference available) is added to the query parameters.
229 232
                     $this->request->query()->set($key, $matches);
Please login to merge, or discard this patch.
src/Comodojo/Dispatcher/Response/Model.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -79,7 +79,9 @@
 block discarded – undo
79 79
         if ( $request->method->get() == 'HEAD' && !in_array($status, array(100,101,102,204,304)) ) {
80 80
             $length = $this->content->length();
81 81
             $this->content->set(null);
82
-            if ($length) $this->headers->set('Content-Length', $length);
82
+            if ($length) {
83
+                $this->headers->set('Content-Length', $length);
84
+            }
83 85
         }
84 86
 
85 87
         if ($this->headers->get('Transfer-Encoding') != null) {
Please login to merge, or discard this patch.
src/Comodojo/Dispatcher/Response/Status.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -62,7 +62,9 @@
 block discarded – undo
62 62
 
63 63
     public function description($code=null) {
64 64
 
65
-        if ( is_null($code) ) return $this->codes->getMessage($this->status_code);
65
+        if ( is_null($code) ) {
66
+            return $this->codes->getMessage($this->status_code);
67
+        }
66 68
         
67 69
         return $this->codes->getMessage($code);
68 70
 
Please login to merge, or discard this patch.