@@ -28,11 +28,13 @@ |
||
| 28 | 28 | |
| 29 | 29 | final public function get($header = null) { |
| 30 | 30 | |
| 31 | - if ( is_null($header) ) return $this->headers; |
|
| 32 | - |
|
| 33 | - else if ( array_key_exists($header, $this->headers) ) return $this->headers[$header]; |
|
| 34 | - |
|
| 35 | - else return null; |
|
| 31 | + if ( is_null($header) ) { |
|
| 32 | + return $this->headers; |
|
| 33 | + } else if ( array_key_exists($header, $this->headers) ) { |
|
| 34 | + return $this->headers[$header]; |
|
| 35 | + } else { |
|
| 36 | + return null; |
|
| 37 | + } |
|
| 36 | 38 | |
| 37 | 39 | } |
| 38 | 40 | |
@@ -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 | |
@@ -96,8 +96,9 @@ discard block |
||
| 96 | 96 | $this->response |
| 97 | 97 | ); |
| 98 | 98 | |
| 99 | + } else { |
|
| 100 | + return null; |
|
| 99 | 101 | } |
| 100 | - else return null; |
|
| 101 | 102 | |
| 102 | 103 | } |
| 103 | 104 | |
@@ -183,7 +184,9 @@ discard block |
||
| 183 | 184 | |
| 184 | 185 | if (preg_match('/' . $value['regex'] . '/', $bits[$key], $matches)) { |
| 185 | 186 | |
| 186 | - if (count($matches) == 1) $matches = $matches[0]; |
|
| 187 | + if (count($matches) == 1) { |
|
| 188 | + $matches = $matches[0]; |
|
| 189 | + } |
|
| 187 | 190 | |
| 188 | 191 | $this->request->query()->set($key, $matches); |
| 189 | 192 | |
@@ -66,10 +66,11 @@ discard block |
||
| 66 | 66 | |
| 67 | 67 | $regex = $this->readpath($folders); |
| 68 | 68 | |
| 69 | - if (isset($this->routes[$regex])) |
|
| 70 | - return $this->routes[$regex]; |
|
| 71 | - else |
|
| 72 | - return null; |
|
| 69 | + if (isset($this->routes[$regex])) { |
|
| 70 | + return $this->routes[$regex]; |
|
| 71 | + } else { |
|
| 72 | + return null; |
|
| 73 | + } |
|
| 73 | 74 | |
| 74 | 75 | } |
| 75 | 76 | |
@@ -79,7 +80,9 @@ discard block |
||
| 79 | 80 | |
| 80 | 81 | $regex = $this->readpath($folders); |
| 81 | 82 | |
| 82 | - if (isset($this->routes[$regex])) unset($this->routes[$regex]); |
|
| 83 | + if (isset($this->routes[$regex])) { |
|
| 84 | + unset($this->routes[$regex]); |
|
| 85 | + } |
|
| 83 | 86 | |
| 84 | 87 | } |
| 85 | 88 | |
@@ -97,7 +100,9 @@ discard block |
||
| 97 | 100 | |
| 98 | 101 | private function readpath($folders = array(), &$value = null, $regex = '') { |
| 99 | 102 | |
| 100 | - if (!empty($folders) && empty($folders[0])) array_shift($folders); |
|
| 103 | + if (!empty($folders) && empty($folders[0])) { |
|
| 104 | + array_shift($folders); |
|
| 105 | + } |
|
| 101 | 106 | |
| 102 | 107 | if (empty($folders)) { |
| 103 | 108 | |
@@ -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 | |