@@ -193,13 +193,13 @@ discard block |
||
| 193 | 193 | */ |
| 194 | 194 | private function setHookMethods(array &$aHookMethods, $xValue) |
| 195 | 195 | { |
| 196 | - foreach($xValue as $sCalledMethod => $xMethodToCall) |
|
| 196 | + foreach ($xValue as $sCalledMethod => $xMethodToCall) |
|
| 197 | 197 | { |
| 198 | - if(is_array($xMethodToCall)) |
|
| 198 | + if (is_array($xMethodToCall)) |
|
| 199 | 199 | { |
| 200 | 200 | $aHookMethods[$sCalledMethod] = $xMethodToCall; |
| 201 | 201 | } |
| 202 | - elseif(is_string($xMethodToCall)) |
|
| 202 | + elseif (is_string($xMethodToCall)) |
|
| 203 | 203 | { |
| 204 | 204 | $aHookMethods[$sCalledMethod] = [$xMethodToCall]; |
| 205 | 205 | } |
@@ -216,18 +216,18 @@ discard block |
||
| 216 | 216 | */ |
| 217 | 217 | public function configure(string $sName, $xValue) |
| 218 | 218 | { |
| 219 | - switch($sName) |
|
| 219 | + switch ($sName) |
|
| 220 | 220 | { |
| 221 | 221 | // Set the separator |
| 222 | 222 | case 'separator': |
| 223 | - if($xValue === '_' || $xValue === '.') |
|
| 223 | + if ($xValue === '_' || $xValue === '.') |
|
| 224 | 224 | { |
| 225 | 225 | $this->sSeparator = $xValue; |
| 226 | 226 | } |
| 227 | 227 | break; |
| 228 | 228 | // Set the protected methods |
| 229 | 229 | case 'protected': |
| 230 | - if(is_array($xValue)) |
|
| 230 | + if (is_array($xValue)) |
|
| 231 | 231 | { |
| 232 | 232 | $this->aProtectedMethods = array_merge($this->aProtectedMethods, $xValue); |
| 233 | 233 | } |
@@ -245,7 +245,7 @@ discard block |
||
| 245 | 245 | $this->aAttributes = array_merge($this->aAttributes, $xValue); |
| 246 | 246 | break; |
| 247 | 247 | case 'excluded': |
| 248 | - $this->bExcluded = (bool)$xValue; |
|
| 248 | + $this->bExcluded = (bool) $xValue; |
|
| 249 | 249 | break; |
| 250 | 250 | default: |
| 251 | 251 | break; |
@@ -295,16 +295,16 @@ discard block |
||
| 295 | 295 | */ |
| 296 | 296 | private function getOptionValue(array $aCommonOptions, array $aMethodOptions, string $sOptionName) |
| 297 | 297 | { |
| 298 | - if(!isset($aCommonOptions[$sOptionName])) |
|
| 298 | + if (!isset($aCommonOptions[$sOptionName])) |
|
| 299 | 299 | { |
| 300 | 300 | return $aMethodOptions[$sOptionName]; |
| 301 | 301 | } |
| 302 | - if(!isset($aMethodOptions[$sOptionName])) |
|
| 302 | + if (!isset($aMethodOptions[$sOptionName])) |
|
| 303 | 303 | { |
| 304 | 304 | return $aCommonOptions[$sOptionName]; |
| 305 | 305 | } |
| 306 | 306 | // If both are not arrays, return the latest. |
| 307 | - if(!is_array($aCommonOptions[$sOptionName]) && !is_array($aMethodOptions[$sOptionName])) |
|
| 307 | + if (!is_array($aCommonOptions[$sOptionName]) && !is_array($aMethodOptions[$sOptionName])) |
|
| 308 | 308 | { |
| 309 | 309 | return $aMethodOptions[$sOptionName]; |
| 310 | 310 | } |
@@ -328,7 +328,7 @@ discard block |
||
| 328 | 328 | $aMethodOptions = isset($this->aOptions[$sMethodName]) ? $this->aOptions[$sMethodName] : []; |
| 329 | 329 | $aOptionNames = array_unique(array_merge(array_keys($aCommonOptions), array_keys($aMethodOptions))); |
| 330 | 330 | $aOptions = []; |
| 331 | - foreach($aOptionNames as $sOptionName) |
|
| 331 | + foreach ($aOptionNames as $sOptionName) |
|
| 332 | 332 | { |
| 333 | 333 | $aOptions[$sOptionName] = $this->getOptionValue($aCommonOptions, $aMethodOptions, $sOptionName); |
| 334 | 334 | } |
@@ -412,11 +412,11 @@ discard block |
||
| 412 | 412 | // $aMethods = $aHookMethods[$sMethod] ?? $aHookMethods['*'] ?? []; |
| 413 | 413 | // The hooks defined at method level are merged with those defined at class level. |
| 414 | 414 | $aMethods = array_merge($aHookMethods['*'] ?? [], $aHookMethods[$sMethod] ?? []); |
| 415 | - foreach($aMethods as $xKey => $xValue) |
|
| 415 | + foreach ($aMethods as $xKey => $xValue) |
|
| 416 | 416 | { |
| 417 | 417 | $sHookName = $xValue; |
| 418 | 418 | $aHookArgs = []; |
| 419 | - if(is_string($xKey)) |
|
| 419 | + if (is_string($xKey)) |
|
| 420 | 420 | { |
| 421 | 421 | $sHookName = $xKey; |
| 422 | 422 | $aHookArgs = is_array($xValue) ? $xValue : [$xValue]; |
@@ -457,7 +457,7 @@ discard block |
||
| 457 | 457 | // $aAttributes = $this->aAttributes[$sMethod] ?? $this->aAttributes['*'] ?? []; |
| 458 | 458 | // The attributes defined at method level are merged with those defined at class level. |
| 459 | 459 | $aAttributes = array_merge($this->aAttributes['*'] ?? [], $this->aAttributes[$sMethod] ?? []); |
| 460 | - foreach($aAttributes as $sName => $sClass) |
|
| 460 | + foreach ($aAttributes as $sName => $sClass) |
|
| 461 | 461 | { |
| 462 | 462 | // Set the protected attributes of the object |
| 463 | 463 | $cSetter = function($c) use($sName, $sClass) { |
@@ -469,7 +469,7 @@ discard block |
||
| 469 | 469 | } |
| 470 | 470 | |
| 471 | 471 | // Set the Jaxon request target in the helper |
| 472 | - if($this->xRegisteredObject instanceof CallableClass) |
|
| 472 | + if ($this->xRegisteredObject instanceof CallableClass) |
|
| 473 | 473 | { |
| 474 | 474 | // Set the protected attributes of the object |
| 475 | 475 | $cSetter = function() use($xTarget) { |