@@ -79,7 +79,9 @@ |
||
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) { |
@@ -62,7 +62,9 @@ |
||
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 |
@@ -30,7 +30,9 @@ |
||
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 |
@@ -183,7 +183,9 @@ discard block |
||
183 | 183 | |
184 | 184 | $cache = $this->cache->setNamespace('dispatcherservice')->get($name); |
185 | 185 | |
186 | - if ( is_null($cache) ) return false; |
|
186 | + if ( is_null($cache) ) { |
|
187 | + return false; |
|
188 | + } |
|
187 | 189 | |
188 | 190 | $this->response->import($cache); |
189 | 191 | |
@@ -220,7 +222,9 @@ discard block |
||
220 | 222 | |
221 | 223 | if ( !empty($params) && is_array($params) ) { |
222 | 224 | |
223 | - foreach($params as $name=>$value) $this->response->headers->set($name, $value); |
|
225 | + foreach($params as $name=>$value) { |
|
226 | + $this->response->headers->set($name, $value); |
|
227 | + } |
|
224 | 228 | } |
225 | 229 | |
226 | 230 | } |
@@ -272,8 +276,11 @@ discard block |
||
272 | 276 | |
273 | 277 | $this->logger->debug("Dispatcher run-cycle ends."); |
274 | 278 | |
275 | - if ( function_exists('fastcgi_finish_request') ) fastcgi_finish_request(); |
|
276 | - else ob_end_clean(); |
|
279 | + if ( function_exists('fastcgi_finish_request') ) { |
|
280 | + fastcgi_finish_request(); |
|
281 | + } else { |
|
282 | + ob_end_clean(); |
|
283 | + } |
|
277 | 284 | |
278 | 285 | return $return; |
279 | 286 |
@@ -61,7 +61,9 @@ |
||
61 | 61 | |
62 | 62 | $status = $this->response->status->get(); |
63 | 63 | |
64 | - if ( !$this->codes->exists($status) ) throw new Exception("Invalid HTTP status code in response"); |
|
64 | + if ( !$this->codes->exists($status) ) { |
|
65 | + throw new Exception("Invalid HTTP status code in response"); |
|
66 | + } |
|
65 | 67 | |
66 | 68 | $message = $this->codes->getMessage($status); |
67 | 69 |
@@ -102,7 +102,9 @@ |
||
102 | 102 | |
103 | 103 | public function getMessage($code) { |
104 | 104 | |
105 | - if ( $this->exists($code) ) return $this->code[$code]; |
|
105 | + if ( $this->exists($code) ) { |
|
106 | + return $this->code[$code]; |
|
107 | + } |
|
106 | 108 | |
107 | 109 | throw new Exception("Invalid HTTP status code $code"); |
108 | 110 |