@@ -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 |
@@ -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 |
@@ -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 |
@@ -47,7 +47,9 @@ discard block |
||
47 | 47 | |
48 | 48 | $callable = $this->convertToListener($class, $event); |
49 | 49 | |
50 | - if ( $callable === false ) return null; |
|
50 | + if ( $callable === false ) { |
|
51 | + return null; |
|
52 | + } |
|
51 | 53 | |
52 | 54 | return $this->addListener($event, $callable, $priority); |
53 | 55 | |
@@ -57,7 +59,9 @@ discard block |
||
57 | 59 | |
58 | 60 | $callable = $this->convertToListener($class, $event); |
59 | 61 | |
60 | - if ( $callable === false ) return null; |
|
62 | + if ( $callable === false ) { |
|
63 | + return null; |
|
64 | + } |
|
61 | 65 | |
62 | 66 | return $this->addOneTimeListener($event, $callable, $priority); |
63 | 67 | |
@@ -106,8 +110,11 @@ discard block |
||
106 | 110 | $priority = isset($plugin['priority']) ? $plugin['priority'] : 0; |
107 | 111 | $onetime = isset($plugin['onetime']) ? $plugin['onetime'] : 0; |
108 | 112 | |
109 | - if ( $onetime ) $this->subscribeOnce($plugin['event'], $plugin['class'], $priority); |
|
110 | - else $this->subscribe($plugin['event'], $plugin['class'], $priority); |
|
113 | + if ( $onetime ) { |
|
114 | + $this->subscribeOnce($plugin['event'], $plugin['class'], $priority); |
|
115 | + } else { |
|
116 | + $this->subscribe($plugin['event'], $plugin['class'], $priority); |
|
117 | + } |
|
111 | 118 | |
112 | 119 | } |
113 | 120 |
@@ -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 |