@@ -45,7 +45,7 @@ |
||
| 45 | 45 | $aFiles = scandir($this->sCacheDir); |
| 46 | 46 | foreach ($aFiles as $sFile) |
| 47 | 47 | { |
| 48 | - if($sFile !== '.' && $sFile !== '..') |
|
| 48 | + if ($sFile !== '.' && $sFile !== '..') |
|
| 49 | 49 | { |
| 50 | 50 | @unlink($this->sCacheDir . DIRECTORY_SEPARATOR . $sFile); |
| 51 | 51 | } |
@@ -45,7 +45,7 @@ |
||
| 45 | 45 | $aFiles = scandir($this->sCacheDir); |
| 46 | 46 | foreach ($aFiles as $sFile) |
| 47 | 47 | { |
| 48 | - if($sFile !== '.' && $sFile !== '..') |
|
| 48 | + if ($sFile !== '.' && $sFile !== '..') |
|
| 49 | 49 | { |
| 50 | 50 | @unlink($this->sCacheDir . DIRECTORY_SEPARATOR . $sFile); |
| 51 | 51 | } |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | function register(): void |
| 31 | 31 | { |
| 32 | 32 | // Do nothing if running in cli. |
| 33 | - if(php_sapi_name() !== 'cli') |
|
| 33 | + if (php_sapi_name() !== 'cli') |
|
| 34 | 34 | { |
| 35 | 35 | _register(); |
| 36 | 36 | }; |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | function register(): void |
| 31 | 31 | { |
| 32 | 32 | // Do nothing if running in cli. |
| 33 | - if(php_sapi_name() !== 'cli') |
|
| 33 | + if (php_sapi_name() !== 'cli') |
|
| 34 | 34 | { |
| 35 | 35 | _register(); |
| 36 | 36 | }; |
@@ -139,16 +139,16 @@ discard block |
||
| 139 | 139 | { |
| 140 | 140 | $aProperties = []; |
| 141 | 141 | $aClassProperties = []; |
| 142 | - foreach($this->aAttributes as $sType => $aValues) |
|
| 142 | + foreach ($this->aAttributes as $sType => $aValues) |
|
| 143 | 143 | { |
| 144 | - if($sType === 'exclude') |
|
| 144 | + if ($sType === 'exclude') |
|
| 145 | 145 | { |
| 146 | 146 | continue; |
| 147 | 147 | } |
| 148 | 148 | |
| 149 | - foreach($aValues as $sMethod => $xData) |
|
| 149 | + foreach ($aValues as $sMethod => $xData) |
|
| 150 | 150 | { |
| 151 | - if($sMethod === '*') |
|
| 151 | + if ($sMethod === '*') |
|
| 152 | 152 | { |
| 153 | 153 | $aClassProperties[$xData->getName()] = $xData->getValue(); |
| 154 | 154 | continue; |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | } |
| 158 | 158 | } |
| 159 | 159 | |
| 160 | - if(count($aClassProperties) > 0) |
|
| 160 | + if (count($aClassProperties) > 0) |
|
| 161 | 161 | { |
| 162 | 162 | $aProperties['*'] = $aClassProperties; |
| 163 | 163 | } |
@@ -75,8 +75,7 @@ discard block |
||
| 75 | 75 | */ |
| 76 | 76 | public function excluded(?string $sMethodName = null): bool |
| 77 | 77 | { |
| 78 | - return $sMethodName === null ? $this->xOptions->excluded() : |
|
| 79 | - $this->xOptions->isProtectedMethod($sMethodName); |
|
| 78 | + return $sMethodName === null ? $this->xOptions->excluded() : $this->xOptions->isProtectedMethod($sMethodName); |
|
| 80 | 79 | } |
| 81 | 80 | |
| 82 | 81 | /** |
@@ -176,11 +175,11 @@ discard block |
||
| 176 | 175 | $sMethod = $this->xTarget->getMethodName(); |
| 177 | 176 | // The hooks defined at method level are merged with those defined at class level. |
| 178 | 177 | $aMethods = array_merge($aHookMethods['*'] ?? [], $aHookMethods[$sMethod] ?? []); |
| 179 | - foreach($aMethods as $xKey => $xValue) |
|
| 178 | + foreach ($aMethods as $xKey => $xValue) |
|
| 180 | 179 | { |
| 181 | 180 | $sHookName = $xValue; |
| 182 | 181 | $aHookArgs = []; |
| 183 | - if(is_string($xKey)) |
|
| 182 | + if (is_string($xKey)) |
|
| 184 | 183 | { |
| 185 | 184 | $sHookName = $xKey; |
| 186 | 185 | $aHookArgs = is_array($xValue) ? $xValue : [$xValue]; |
@@ -218,7 +217,7 @@ discard block |
||
| 218 | 217 | // Warning: dynamic properties will be deprecated in PHP8.2. |
| 219 | 218 | $this->$sAttr = $xDiValue; |
| 220 | 219 | }; |
| 221 | - foreach($aDiOptions as $sAttr => $sClass) |
|
| 220 | + foreach ($aDiOptions as $sAttr => $sClass) |
|
| 222 | 221 | { |
| 223 | 222 | $this->setDiAttribute($xComponent, $sAttr, $this->di->get($sClass), $cSetter); |
| 224 | 223 | } |
@@ -50,8 +50,7 @@ |
||
| 50 | 50 | public function rq(string $sClassName = ''): ?JxnCall |
| 51 | 51 | { |
| 52 | 52 | $sClassName = trim($sClassName); |
| 53 | - return $sClassName === '' ? $this->cdi->getFunctionRequestFactory() : |
|
| 54 | - $this->cdi->getComponentRequestFactory($sClassName); |
|
| 53 | + return $sClassName === '' ? $this->cdi->getFunctionRequestFactory() : $this->cdi->getComponentRequestFactory($sClassName); |
|
| 55 | 54 | } |
| 56 | 55 | |
| 57 | 56 | /** |
@@ -51,12 +51,12 @@ |
||
| 51 | 51 | $sMetadataVar = '$xMetadata'; |
| 52 | 52 | $sDataVar = '$xData'; |
| 53 | 53 | $aCalls = ["$sMetadataVar = new " . Metadata::class . '();']; |
| 54 | - foreach($xMetadata->getAttributes() as $sType => $aValues) |
|
| 54 | + foreach ($xMetadata->getAttributes() as $sType => $aValues) |
|
| 55 | 55 | { |
| 56 | - foreach($aValues as $sMethod => $xData) |
|
| 56 | + foreach ($aValues as $sMethod => $xData) |
|
| 57 | 57 | { |
| 58 | 58 | $aCalls[] = "$sDataVar = {$sMetadataVar}->{$sType}('{$sMethod}');"; |
| 59 | - foreach($xData->encode($sDataVar) as $sCall) |
|
| 59 | + foreach ($xData->encode($sDataVar) as $sCall) |
|
| 60 | 60 | { |
| 61 | 61 | $aCalls[] = $sCall; |
| 62 | 62 | } |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | */ |
| 52 | 52 | protected function validateAttr(string $sAttr): void |
| 53 | 53 | { |
| 54 | - if(preg_match('/^[a-zA-Z][a-zA-Z0-9_]*$/', $sAttr) > 0) |
|
| 54 | + if (preg_match('/^[a-zA-Z][a-zA-Z0-9_]*$/', $sAttr) > 0) |
|
| 55 | 55 | { |
| 56 | 56 | return; |
| 57 | 57 | } |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | */ |
| 66 | 66 | protected function validateClass(string $sClass): void |
| 67 | 67 | { |
| 68 | - if(preg_match('/^(\\\)?([a-zA-Z][a-zA-Z0-9_]*)(\\\[a-zA-Z][a-zA-Z0-9_]*)*$/', $sClass) > 0) |
|
| 68 | + if (preg_match('/^(\\\)?([a-zA-Z][a-zA-Z0-9_]*)(\\\[a-zA-Z][a-zA-Z0-9_]*)*$/', $sClass) > 0) |
|
| 69 | 69 | { |
| 70 | 70 | return; |
| 71 | 71 | } |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | public function encode(string $sVarName): array |
| 93 | 93 | { |
| 94 | 94 | $aCalls = []; |
| 95 | - foreach($this->aProperties as $sAttr => $sClass) |
|
| 95 | + foreach ($this->aProperties as $sAttr => $sClass) |
|
| 96 | 96 | { |
| 97 | 97 | $aCalls[] = "{$sVarName}->addValue('$sAttr', '" . addslashes($sClass) . "');"; |
| 98 | 98 | } |