Completed
Push — 4.0 ( ad8a54...ed771a )
by Marco
06:33
created
src/Comodojo/Dispatcher/Response/Preprocessor/Status201.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,9 @@
 block discarded – undo
30 30
 
31 31
         $location = $this->response()->location()->get();
32 32
 
33
-        if ( $location != null ) $this->response()->headers()->set("Location: ".$location);
33
+        if ( $location != null ) {
34
+            $this->response()->headers()->set("Location: ".$location);
35
+        }
34 36
 
35 37
         parent::consolidate();
36 38
 
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/Response/Model.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -119,7 +119,9 @@
 block discarded – undo
119 119
         if ( $request->method()->get() == 'HEAD' && !in_array($status, array(100,101,102,204,304)) ) {
120 120
             $length = $this->content()->length();
121 121
             $this->content()->set(null);
122
-            if ($length) $this->headers()->set('Content-Length', $length);
122
+            if ($length) {
123
+                $this->headers()->set('Content-Length', $length);
124
+            }
123 125
         }
124 126
 
125 127
         if ($this->headers()->get('Transfer-Encoding') != null) {
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/Dispatcher.php 1 patch
Braces   +11 added lines, -4 removed lines patch added patch discarded remove patch
@@ -247,7 +247,9 @@  discard block
 block discarded – undo
247 247
 
248 248
         $cache = $this->cache()->setNamespace('dispatcherservice')->get($name);
249 249
 
250
-        if ( is_null($cache) ) return false;
250
+        if ( is_null($cache) ) {
251
+            return false;
252
+        }
251 253
 
252 254
         $this->response = $cache;
253 255
 
@@ -284,7 +286,9 @@  discard block
 block discarded – undo
284 286
 
285 287
         if ( !empty($params) && is_array($params) ) {
286 288
 
287
-            foreach($params as $name=>$value) $this->response()->headers()->set($name, $value);
289
+            foreach($params as $name=>$value) {
290
+                $this->response()->headers()->set($name, $value);
291
+            }
288 292
         }
289 293
 
290 294
     }
@@ -336,8 +340,11 @@  discard block
 block discarded – undo
336 340
 
337 341
         $this->logger()->debug("Dispatcher run-cycle ends.");
338 342
 
339
-        if ( function_exists('fastcgi_finish_request') ) fastcgi_finish_request();
340
-        else ob_end_clean();
343
+        if ( function_exists('fastcgi_finish_request') ) {
344
+            fastcgi_finish_request();
345
+        } else {
346
+            ob_end_clean();
347
+        }
341 348
 
342 349
         return $return;
343 350
 
Please login to merge, or discard this patch.
src/Comodojo/Dispatcher/Output/Processor.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -130,7 +130,9 @@
 block discarded – undo
130 130
 
131 131
         $status = $this->response->status()->get();
132 132
 
133
-        if ( !array_key_exists($status, $this->codes) ) throw new Exception("Invalid HTTP status code in response");
133
+        if ( !array_key_exists($status, $this->codes) ) {
134
+            throw new Exception("Invalid HTTP status code in response");
135
+        }
134 136
 
135 137
         $message = $this->codes[$status];
136 138
 
Please login to merge, or discard this patch.