@@ -120,22 +120,22 @@ discard block |
||
| 120 | 120 | */ |
| 121 | 121 | public function configure($sName, $sValue) |
| 122 | 122 | { |
| 123 | - switch($sName) |
|
| 123 | + switch ($sName) |
|
| 124 | 124 | { |
| 125 | 125 | // Set the separator |
| 126 | 126 | case 'separator': |
| 127 | - if($sValue == '_' || $sValue == '.') |
|
| 127 | + if ($sValue == '_' || $sValue == '.') |
|
| 128 | 128 | { |
| 129 | 129 | $this->separator = $sValue; |
| 130 | 130 | } |
| 131 | 131 | break; |
| 132 | 132 | // Set the protected methods |
| 133 | 133 | case 'protected': |
| 134 | - if(is_array($sValue)) |
|
| 134 | + if (is_array($sValue)) |
|
| 135 | 135 | { |
| 136 | 136 | $this->aProtectedMethods = array_merge($this->aProtectedMethods, $sValue); |
| 137 | 137 | } |
| 138 | - elseif(is_string($sValue)) |
|
| 138 | + elseif (is_string($sValue)) |
|
| 139 | 139 | { |
| 140 | 140 | $this->aProtectedMethods[] = $sValue; |
| 141 | 141 | } |
@@ -153,16 +153,16 @@ discard block |
||
| 153 | 153 | public function getMethods() |
| 154 | 154 | { |
| 155 | 155 | $aMethods = []; |
| 156 | - foreach($this->reflectionClass->getMethods(\ReflectionMethod::IS_PUBLIC) as $xMethod) |
|
| 156 | + foreach ($this->reflectionClass->getMethods(\ReflectionMethod::IS_PUBLIC) as $xMethod) |
|
| 157 | 157 | { |
| 158 | 158 | $sMethodName = $xMethod->getShortName(); |
| 159 | 159 | // Don't take magic __call, __construct, __destruct methods |
| 160 | - if(strlen($sMethodName) > 2 && substr($sMethodName, 0, 2) == '__') |
|
| 160 | + if (strlen($sMethodName) > 2 && substr($sMethodName, 0, 2) == '__') |
|
| 161 | 161 | { |
| 162 | 162 | continue; |
| 163 | 163 | } |
| 164 | 164 | // Don't take excluded methods |
| 165 | - if(in_array($sMethodName, $this->aProtectedMethods)) |
|
| 165 | + if (in_array($sMethodName, $this->aProtectedMethods)) |
|
| 166 | 166 | { |
| 167 | 167 | continue; |
| 168 | 168 | } |
@@ -178,15 +178,15 @@ discard block |
||
| 178 | 178 | */ |
| 179 | 179 | public function getRegisteredObject() |
| 180 | 180 | { |
| 181 | - if($this->registeredObject == null) |
|
| 181 | + if ($this->registeredObject == null) |
|
| 182 | 182 | { |
| 183 | 183 | $di = jaxon()->di(); |
| 184 | 184 | // Use the Reflection class to get the parameters of the constructor |
| 185 | - if(($constructor = $this->reflectionClass->getConstructor()) != null) |
|
| 185 | + if (($constructor = $this->reflectionClass->getConstructor()) != null) |
|
| 186 | 186 | { |
| 187 | 187 | $parameters = $constructor->getParameters(); |
| 188 | 188 | $parameterInstances = []; |
| 189 | - foreach($parameters as $parameter) |
|
| 189 | + foreach ($parameters as $parameter) |
|
| 190 | 190 | { |
| 191 | 191 | // Get the parameter instance from the DI |
| 192 | 192 | $parameterInstances[] = $di->get($parameter->getClass()->getName()); |
@@ -223,14 +223,14 @@ discard block |
||
| 223 | 223 | */ |
| 224 | 224 | public function call($sMethod, $aArgs) |
| 225 | 225 | { |
| 226 | - if(!$this->hasMethod($sMethod)) |
|
| 226 | + if (!$this->hasMethod($sMethod)) |
|
| 227 | 227 | { |
| 228 | 228 | return; |
| 229 | 229 | } |
| 230 | 230 | $reflectionMethod = $this->reflectionClass->getMethod($sMethod); |
| 231 | 231 | $registeredObject = $this->getRegisteredObject(); |
| 232 | 232 | $response = $reflectionMethod->invokeArgs($registeredObject, $aArgs); |
| 233 | - if(($response)) |
|
| 233 | + if (($response)) |
|
| 234 | 234 | { |
| 235 | 235 | $this->getResponseManager()->append($response); |
| 236 | 236 | } |