@@ -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 |
@@ -32,7 +32,9 @@ |
||
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 |
@@ -33,7 +33,9 @@ |
||
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 |
@@ -119,7 +119,9 @@ |
||
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) { |
@@ -96,7 +96,9 @@ discard block |
||
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 |
||
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 |
@@ -247,7 +247,9 @@ discard block |
||
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 |
||
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 |
||
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 |
@@ -130,7 +130,9 @@ |
||
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 |