@@ -47,7 +47,9 @@ |
||
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 |
@@ -81,7 +81,9 @@ discard block |
||
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 |
||
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 |
@@ -149,14 +149,24 @@ discard block |
||
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 |
||
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) { |