@@ -41,7 +41,9 @@ |
||
41 | 41 | */ |
42 | 42 | private static function getHeaders() { |
43 | 43 | |
44 | - if ( function_exists('getallheaders') ) return getallheaders(); |
|
44 | + if ( function_exists('getallheaders') ) { |
|
45 | + return getallheaders(); |
|
46 | + } |
|
45 | 47 | |
46 | 48 | $headers = array(); |
47 | 49 |
@@ -103,7 +103,9 @@ |
||
103 | 103 | */ |
104 | 104 | $param_regex .= $this->param($key, $string, $value); |
105 | 105 | |
106 | - if ($value->isQueryRequired($key)) $param_required = true; |
|
106 | + if ($value->isQueryRequired($key)) { |
|
107 | + $param_required = true; |
|
108 | + } |
|
107 | 109 | |
108 | 110 | $this->logger->debug("PARAMETER REGEX: " . $param_regex); |
109 | 111 |
@@ -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 |
@@ -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 |
@@ -105,7 +105,9 @@ discard block |
||
105 | 105 | |
106 | 106 | if (!$this->bypass_routing) { |
107 | 107 | |
108 | - if (!$this->parse()) throw new DispatcherException("Unable to find a valid route for the specified uri", 0, null, 404); |
|
108 | + if (!$this->parse()) { |
|
109 | + throw new DispatcherException("Unable to find a valid route for the specified uri", 0, null, 404); |
|
110 | + } |
|
109 | 111 | |
110 | 112 | } |
111 | 113 | |
@@ -133,8 +135,9 @@ discard block |
||
133 | 135 | $this->extra |
134 | 136 | ); |
135 | 137 | |
138 | + } else { |
|
139 | + return null; |
|
136 | 140 | } |
137 | - else return null; |
|
138 | 141 | |
139 | 142 | } |
140 | 143 |
@@ -223,7 +223,10 @@ |
||
223 | 223 | */ |
224 | 224 | if (preg_match('/^' . $value['regex'] . '$/', $bits[$key], $matches)) { |
225 | 225 | |
226 | - if (count($matches) == 1) $matches = $matches[0]; // This is the case where no backreferences are present or available. |
|
226 | + if (count($matches) == 1) { |
|
227 | + $matches = $matches[0]; |
|
228 | + } |
|
229 | + // This is the case where no backreferences are present or available. |
|
227 | 230 | |
228 | 231 | // The extracted value (with any backreference available) is added to the query parameters. |
229 | 232 | $this->request->query()->set($key, $matches); |
@@ -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 |