@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | use ResponseTrait; |
| 49 | 49 | use ExtraTrait; |
| 50 | 50 | |
| 51 | - protected static $supported_methods = ['GET','PUT','POST','DELETE','OPTIONS','HEAD','TRACE','CONNECT','PURGE']; |
|
| 51 | + protected static $supported_methods = ['GET', 'PUT', 'POST', 'DELETE', 'OPTIONS', 'HEAD', 'TRACE', 'CONNECT', 'PURGE']; |
|
| 52 | 52 | |
| 53 | 53 | public function __construct( |
| 54 | 54 | Configuration $configuration, |
@@ -81,9 +81,9 @@ discard block |
||
| 81 | 81 | |
| 82 | 82 | $supported_methods = $this->getConfiguration()->get('supported-http-methods'); |
| 83 | 83 | |
| 84 | - if ( is_null($supported_methods) ) $supported_methods = self::$supported_methods; |
|
| 84 | + if (is_null($supported_methods)) $supported_methods = self::$supported_methods; |
|
| 85 | 85 | |
| 86 | - if ( method_exists($this, 'any') ) { |
|
| 86 | + if (method_exists($this, 'any')) { |
|
| 87 | 87 | |
| 88 | 88 | return $supported_methods; |
| 89 | 89 | |
@@ -91,9 +91,9 @@ discard block |
||
| 91 | 91 | |
| 92 | 92 | $implemented_methods = []; |
| 93 | 93 | |
| 94 | - foreach ( $supported_methods as $method ) { |
|
| 94 | + foreach ($supported_methods as $method) { |
|
| 95 | 95 | |
| 96 | - if ( method_exists($this, strtolower($method)) ) array_push($implemented_methods, $method); |
|
| 96 | + if (method_exists($this, strtolower($method))) array_push($implemented_methods, $method); |
|
| 97 | 97 | |
| 98 | 98 | } |
| 99 | 99 | |
@@ -109,11 +109,11 @@ discard block |
||
| 109 | 109 | |
| 110 | 110 | $method = strtolower($method); |
| 111 | 111 | |
| 112 | - if ( method_exists($this, $method) ) { |
|
| 112 | + if (method_exists($this, $method)) { |
|
| 113 | 113 | |
| 114 | 114 | return $method; |
| 115 | 115 | |
| 116 | - } else if ( method_exists($this, 'any') ) { |
|
| 116 | + } else if (method_exists($this, 'any')) { |
|
| 117 | 117 | |
| 118 | 118 | return 'any'; |
| 119 | 119 | |
@@ -81,7 +81,9 @@ discard block |
||
| 81 | 81 | |
| 82 | 82 | $supported_methods = $this->getConfiguration()->get('supported-http-methods'); |
| 83 | 83 | |
| 84 | - if ( is_null($supported_methods) ) $supported_methods = self::$supported_methods; |
|
| 84 | + if ( is_null($supported_methods) ) { |
|
| 85 | + $supported_methods = self::$supported_methods; |
|
| 86 | + } |
|
| 85 | 87 | |
| 86 | 88 | if ( method_exists($this, 'any') ) { |
| 87 | 89 | |
@@ -93,7 +95,9 @@ discard block |
||
| 93 | 95 | |
| 94 | 96 | foreach ( $supported_methods as $method ) { |
| 95 | 97 | |
| 96 | - if ( method_exists($this, strtolower($method)) ) array_push($implemented_methods, $method); |
|
| 98 | + if ( method_exists($this, strtolower($method)) ) { |
|
| 99 | + array_push($implemented_methods, $method); |
|
| 100 | + } |
|
| 97 | 101 | |
| 98 | 102 | } |
| 99 | 103 | |
@@ -41,9 +41,9 @@ |
||
| 41 | 41 | |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | - public function set($content=null) { |
|
| 44 | + public function set($content = null) { |
|
| 45 | 45 | |
| 46 | - if ( !is_scalar($content) && $content != null ) { |
|
| 46 | + if (!is_scalar($content) && $content != null) { |
|
| 47 | 47 | |
| 48 | 48 | throw new Exception("Invalid HTTP content"); |
| 49 | 49 | |