Completed
Push — 4.0 ( 582652...6b254d )
by Marco
02:44
created
src/Comodojo/Dispatcher/Cache/ServerCache.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -47,7 +47,9 @@
 block discarded – undo
47 47
 
48 48
         $cache_object = $this->getCache()->setNamespace(self::$cache_namespace)->get($name);
49 49
 
50
-        if ( is_null($cache_object) ) return false;
50
+        if ( is_null($cache_object) ) {
51
+            return false;
52
+        }
51 53
 
52 54
         $response->import($cache_object);
53 55
 
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
@@ -81,7 +81,9 @@  discard block
 block discarded – undo
81 81
 
82 82
         $supported_methods = $this->getConfiguration()->get('supported-http-methods');
83 83
 
84
-        if ( is_null($supported_methods) ) $supported_methods = self::$supported_methods;
84
+        if ( is_null($supported_methods) ) {
85
+            $supported_methods = self::$supported_methods;
86
+        }
85 87
 
86 88
         if ( method_exists($this, 'any') ) {
87 89
 
@@ -93,7 +95,9 @@  discard block
 block discarded – undo
93 95
 
94 96
         foreach ( $supported_methods as $method ) {
95 97
 
96
-            if ( method_exists($this, strtolower($method)) ) array_push($implemented_methods, $method);
98
+            if ( method_exists($this, strtolower($method)) ) {
99
+                array_push($implemented_methods, $method);
100
+            }
97 101
 
98 102
         }
99 103
 
Please login to merge, or discard this patch.
src/Comodojo/Dispatcher/Response/Model.php 1 patch
Braces   +18 added lines, -6 removed lines patch added patch discarded remove patch
@@ -149,14 +149,24 @@  discard block
 block discarded – undo
149 149
 
150 150
     public function import($data) {
151 151
 
152
-        if ( isset($data->headers) ) $this->setHeaders($data->headers);
153
-        if ( isset($data->status) ) $this->setStatus($data->status);
154
-        if ( isset($data->content) ) $this->setContent($data->content);
155
-        if ( isset($data->location) ) $this->setLocation($data->location);
152
+        if ( isset($data->headers) ) {
153
+            $this->setHeaders($data->headers);
154
+        }
155
+        if ( isset($data->status) ) {
156
+            $this->setStatus($data->status);
157
+        }
158
+        if ( isset($data->content) ) {
159
+            $this->setContent($data->content);
160
+        }
161
+        if ( isset($data->location) ) {
162
+            $this->setLocation($data->location);
163
+        }
156 164
 
157 165
         if ( isset($data->cookies) && is_array($data->cookies) ) {
158 166
             $cookies = $this->getCookies();
159
-            foreach ($data->cookies as $name => $cookie) $cookies->add($cookie);
167
+            foreach ($data->cookies as $name => $cookie) {
168
+                $cookies->add($cookie);
169
+            }
160 170
         }
161 171
 
162 172
     }
@@ -187,7 +197,9 @@  discard block
 block discarded – undo
187 197
         if ( (string) $request->getMethod() == 'HEAD' && !in_array($status, self::$no_content_statuses) ) {
188 198
             $length = $content->length();
189 199
             $content->set(null);
190
-            if ($length) $headers->set('Content-Length', $length);
200
+            if ($length) {
201
+                $headers->set('Content-Length', $length);
202
+            }
191 203
         }
192 204
 
193 205
         if ($headers->get('Transfer-Encoding') != null) {
Please login to merge, or discard this patch.