@@ -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 |
@@ -64,7 +64,9 @@ |
||
64 | 64 | |
65 | 65 | $handler = $this->getHandler($provider, $parameters); |
66 | 66 | |
67 | - if ( $handler instanceof CacheInterface ) $manager->addProvider($handler); |
|
67 | + if ( $handler instanceof CacheInterface ) { |
|
68 | + $manager->addProvider($handler); |
|
69 | + } |
|
68 | 70 | |
69 | 71 | } |
70 | 72 |
@@ -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); |
@@ -70,10 +70,11 @@ discard block |
||
70 | 70 | |
71 | 71 | $regex = $this->readpath($folders); |
72 | 72 | |
73 | - if (isset($this->routes[$regex])) |
|
74 | - return $this->routes[$regex]; |
|
75 | - else |
|
76 | - return null; |
|
73 | + if (isset($this->routes[$regex])) { |
|
74 | + return $this->routes[$regex]; |
|
75 | + } else { |
|
76 | + return null; |
|
77 | + } |
|
77 | 78 | |
78 | 79 | } |
79 | 80 | |
@@ -83,7 +84,9 @@ discard block |
||
83 | 84 | |
84 | 85 | $regex = $this->readpath($folders); |
85 | 86 | |
86 | - if (isset($this->routes[$regex])) unset($this->routes[$regex]); |
|
87 | + if (isset($this->routes[$regex])) { |
|
88 | + unset($this->routes[$regex]); |
|
89 | + } |
|
87 | 90 | |
88 | 91 | } |
89 | 92 | |
@@ -164,7 +167,9 @@ discard block |
||
164 | 167 | |
165 | 168 | } else { |
166 | 169 | // if the element is not a json string, I assume it's the service name |
167 | - if (!isset($value['service'])) $value['service'] = array(); |
|
170 | + if (!isset($value['service'])) { |
|
171 | + $value['service'] = array(); |
|
172 | + } |
|
168 | 173 | array_push($value['service'], $folder); |
169 | 174 | |
170 | 175 | return $this->readpath( |