@@ -28,16 +28,16 @@ |
||
| 28 | 28 | |
| 29 | 29 | final public function get($parameter=null) { |
| 30 | 30 | |
| 31 | - if ( is_null($parameter) ) return $this->parameters; |
|
| 32 | - |
|
| 33 | - else if ( array_key_exists($parameter, $this->parameters) ) { |
|
| 31 | + if ( is_null($parameter) ) { |
|
| 32 | + return $this->parameters; |
|
| 33 | + } else if ( array_key_exists($parameter, $this->parameters) ) { |
|
| 34 | 34 | |
| 35 | 35 | return $this->parameters[$parameter]; |
| 36 | 36 | |
| 37 | + } else { |
|
| 38 | + return null; |
|
| 37 | 39 | } |
| 38 | 40 | |
| 39 | - else return null; |
|
| 40 | - |
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | final public function set($parameter, $value) { |
@@ -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 | |
@@ -104,7 +104,9 @@ |
||
| 104 | 104 | |
| 105 | 105 | foreach ( $supported_methods as $method ) { |
| 106 | 106 | |
| 107 | - if ( method_exists($this, strtolower($method)) ) array_push($implemented_methods,$method); |
|
| 107 | + if ( method_exists($this, strtolower($method)) ) { |
|
| 108 | + array_push($implemented_methods,$method); |
|
| 109 | + } |
|
| 108 | 110 | |
| 109 | 111 | } |
| 110 | 112 | |
@@ -29,11 +29,13 @@ discard block |
||
| 29 | 29 | |
| 30 | 30 | public function get($header = null) { |
| 31 | 31 | |
| 32 | - if ( is_null($header) ) return $this->headers; |
|
| 33 | - |
|
| 34 | - else if ( array_key_exists($header, $this->headers) ) return $this->headers[$header]; |
|
| 35 | - |
|
| 36 | - else return null; |
|
| 32 | + if ( is_null($header) ) { |
|
| 33 | + return $this->headers; |
|
| 34 | + } else if ( array_key_exists($header, $this->headers) ) { |
|
| 35 | + return $this->headers[$header]; |
|
| 36 | + } else { |
|
| 37 | + return null; |
|
| 38 | + } |
|
| 37 | 39 | |
| 38 | 40 | } |
| 39 | 41 | |
@@ -50,7 +52,9 @@ discard block |
||
| 50 | 52 | |
| 51 | 53 | return (string)($header.':'.$this->headers[$header]); |
| 52 | 54 | |
| 53 | - } else return null; |
|
| 55 | + } else { |
|
| 56 | + return null; |
|
| 57 | + } |
|
| 54 | 58 | |
| 55 | 59 | } |
| 56 | 60 | |
@@ -35,9 +35,11 @@ |
||
| 35 | 35 | |
| 36 | 36 | final public function setTimestamp($time = null) { |
| 37 | 37 | |
| 38 | - if ( is_float($time) ) $this->timestamp = $time; |
|
| 39 | - |
|
| 40 | - else $this->timestamp = microtime(true); |
|
| 38 | + if ( is_float($time) ) { |
|
| 39 | + $this->timestamp = $time; |
|
| 40 | + } else { |
|
| 41 | + $this->timestamp = microtime(true); |
|
| 42 | + } |
|
| 41 | 43 | |
| 42 | 44 | return $this; |
| 43 | 45 | |
@@ -63,7 +63,9 @@ |
||
| 63 | 63 | |
| 64 | 64 | $handler = $this->getHandler($provider, $parameters); |
| 65 | 65 | |
| 66 | - if ( $handler instanceof HandlerInterface ) $logger->pushHandler($handler); |
|
| 66 | + if ( $handler instanceof HandlerInterface ) { |
|
| 67 | + $logger->pushHandler($handler); |
|
| 68 | + } |
|
| 67 | 69 | |
| 68 | 70 | } |
| 69 | 71 | |
@@ -113,8 +113,9 @@ discard block |
||
| 113 | 113 | $this->extra |
| 114 | 114 | ); |
| 115 | 115 | |
| 116 | + } else { |
|
| 117 | + return null; |
|
| 116 | 118 | } |
| 117 | - else return null; |
|
| 118 | 119 | |
| 119 | 120 | } |
| 120 | 121 | |
@@ -294,7 +295,10 @@ discard block |
||
| 294 | 295 | */ |
| 295 | 296 | if (preg_match('/^' . $value['regex'] . '$/', $bits[$key], $matches)) { |
| 296 | 297 | |
| 297 | - if (count($matches) == 1) $matches = $matches[0]; // This is the case where no backreferences are present or available. |
|
| 298 | + if (count($matches) == 1) { |
|
| 299 | + $matches = $matches[0]; |
|
| 300 | + } |
|
| 301 | + // This is the case where no backreferences are present or available. |
|
| 298 | 302 | |
| 299 | 303 | // The extracted value (with any backreference available) is added to the query parameters. |
| 300 | 304 | $this->request->query()->set($key, $matches); |
@@ -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 | |
@@ -104,7 +104,9 @@ |
||
| 104 | 104 | |
| 105 | 105 | if (!$this->bypass) { |
| 106 | 106 | |
| 107 | - if (!$this->parse()) throw new DispatcherException("Unable to find a valid route for the specified uri", 0, null, 404); |
|
| 107 | + if (!$this->parse()) { |
|
| 108 | + throw new DispatcherException("Unable to find a valid route for the specified uri", 0, null, 404); |
|
| 109 | + } |
|
| 108 | 110 | |
| 109 | 111 | } |
| 110 | 112 | |