@@ -45,16 +45,16 @@ discard block |
||
| 45 | 45 | $xType = $xParameter->getType(); |
| 46 | 46 | $sParameterName = '$' . $xParameter->getName(); |
| 47 | 47 | // Check the parameter class first. |
| 48 | - if($xType instanceof ReflectionNamedType) |
|
| 48 | + if ($xType instanceof ReflectionNamedType) |
|
| 49 | 49 | { |
| 50 | 50 | $sParameterType = $xType->getName(); |
| 51 | 51 | // The class + the name |
| 52 | - if($this->cn()->has("$sParameterType $sParameterName")) |
|
| 52 | + if ($this->cn()->has("$sParameterType $sParameterName")) |
|
| 53 | 53 | { |
| 54 | 54 | return $this->cn()->get("$sParameterType $sParameterName"); |
| 55 | 55 | } |
| 56 | 56 | // The class only |
| 57 | - if($this->cn()->has($sParameterType)) |
|
| 57 | + if ($this->cn()->has($sParameterType)) |
|
| 58 | 58 | { |
| 59 | 59 | return $this->cn()->get($sParameterType); |
| 60 | 60 | } |
@@ -74,13 +74,13 @@ discard block |
||
| 74 | 74 | */ |
| 75 | 75 | public function make(string|ReflectionClass $xClass): mixed |
| 76 | 76 | { |
| 77 | - if(is_string($xClass)) |
|
| 77 | + if (is_string($xClass)) |
|
| 78 | 78 | { |
| 79 | 79 | // Create the reflection class instance |
| 80 | 80 | $xClass = new ReflectionClass($xClass); |
| 81 | 81 | } |
| 82 | 82 | // Use the Reflection class to get the parameters of the constructor |
| 83 | - if(($constructor = $xClass->getConstructor()) === null) |
|
| 83 | + if (($constructor = $xClass->getConstructor()) === null) |
|
| 84 | 84 | { |
| 85 | 85 | return $xClass->newInstance(); |
| 86 | 86 | } |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | |
| 83 | 83 | // Register the logger component, and export to js. |
| 84 | 84 | $this->di->callback()->boot(function() { |
| 85 | - if($this->di->config()->loggingEnabled()) |
|
| 85 | + if ($this->di->config()->loggingEnabled()) |
|
| 86 | 86 | { |
| 87 | 87 | $this->saveComponent(LoggerComponent::class, [ |
| 88 | 88 | 'separator' => '.', |
@@ -189,13 +189,13 @@ discard block |
||
| 189 | 189 | try |
| 190 | 190 | { |
| 191 | 191 | // Make sure the registered class exists |
| 192 | - if(isset($aOptions['include'])) |
|
| 192 | + if (isset($aOptions['include'])) |
|
| 193 | 193 | { |
| 194 | 194 | require_once $aOptions['include']; |
| 195 | 195 | } |
| 196 | 196 | $xReflectionClass = new ReflectionClass($sClassName); |
| 197 | 197 | // Check if the class is registrable |
| 198 | - if(!$xReflectionClass->isInstantiable()) |
|
| 198 | + if (!$xReflectionClass->isInstantiable()) |
|
| 199 | 199 | { |
| 200 | 200 | return; |
| 201 | 201 | } |
@@ -205,12 +205,12 @@ discard block |
||
| 205 | 205 | $sClassKey = $this->getReflectionClassKey($sClassName); |
| 206 | 206 | $this->val($sClassKey, $xReflectionClass); |
| 207 | 207 | // Register the user class, but only if the user didn't already. |
| 208 | - if(!$this->has($sClassName)) |
|
| 208 | + if (!$this->has($sClassName)) |
|
| 209 | 209 | { |
| 210 | 210 | $this->set($sClassName, fn() => $this->make($this->get($sClassKey))); |
| 211 | 211 | } |
| 212 | 212 | } |
| 213 | - catch(ReflectionException $e) |
|
| 213 | + catch (ReflectionException $e) |
|
| 214 | 214 | { |
| 215 | 215 | throw new SetupException($this->cn()->g(Translator::class) |
| 216 | 216 | ->trans('errors.class.invalid', ['name' => $sClassName])); |
@@ -232,7 +232,7 @@ discard block |
||
| 232 | 232 | |
| 233 | 233 | $sComponentObject = $this->getCallableObjectKey($sClassName); |
| 234 | 234 | // Prevent duplication. It's important not to use the class name here. |
| 235 | - if($this->has($sComponentObject)) |
|
| 235 | + if ($this->has($sComponentObject)) |
|
| 236 | 236 | { |
| 237 | 237 | return $sClassName; |
| 238 | 238 | } |
@@ -258,14 +258,14 @@ discard block |
||
| 258 | 258 | |
| 259 | 259 | // Initialize the user class instance |
| 260 | 260 | $this->xContainer->extend($sClassName, function($xClassInstance) use($sClassName) { |
| 261 | - if($xClassInstance instanceof AbstractComponent) |
|
| 261 | + if ($xClassInstance instanceof AbstractComponent) |
|
| 262 | 262 | { |
| 263 | 263 | $xHelper = $this->get($this->getCallableHelperKey($sClassName)); |
| 264 | 264 | $xHelper->xTarget = $this->xTarget; |
| 265 | 265 | |
| 266 | 266 | // Call the protected "initComponent()" method of the Component class. |
| 267 | 267 | $cSetter = function($di, $xHelper) { |
| 268 | - $this->initComponent($di, $xHelper); // "$this" here refers to the Component class. |
|
| 268 | + $this->initComponent($di, $xHelper); // "$this" here refers to the Component class. |
|
| 269 | 269 | }; |
| 270 | 270 | $cSetter = $cSetter->bindTo($xClassInstance, $xClassInstance); |
| 271 | 271 | call_user_func($cSetter, $this->di, $xHelper); |
@@ -280,7 +280,7 @@ discard block |
||
| 280 | 280 | /** @var CallableObject */ |
| 281 | 281 | $xCallableObject = $this->get($this->getCallableObjectKey($sClassName)); |
| 282 | 282 | $xCallableObject->setDiClassAttributes($xClassInstance); |
| 283 | - if($this->xTarget !== null) |
|
| 283 | + if ($this->xTarget !== null) |
|
| 284 | 284 | { |
| 285 | 285 | $sMethodName = $this->xTarget->getMethodName(); |
| 286 | 286 | $xCallableObject->setDiMethodAttributes($xClassInstance, $sMethodName); |
@@ -343,17 +343,17 @@ discard block |
||
| 343 | 343 | public function getComponentRequestFactory(string $sClassName): ?JxnCall |
| 344 | 344 | { |
| 345 | 345 | $sClassName = trim($sClassName, " \t"); |
| 346 | - if($sClassName === '') |
|
| 346 | + if ($sClassName === '') |
|
| 347 | 347 | { |
| 348 | 348 | return null; |
| 349 | 349 | } |
| 350 | 350 | |
| 351 | 351 | $sFactoryKey = $this->getRequestFactoryKey($sClassName); |
| 352 | - if(!$this->has($sFactoryKey)) |
|
| 352 | + if (!$this->has($sFactoryKey)) |
|
| 353 | 353 | { |
| 354 | 354 | $this->xContainer->offsetSet($sFactoryKey, function() use($sClassName) { |
| 355 | 355 | $sComponentId = str_replace('\\', '.', $sClassName); |
| 356 | - if(!($xCallable = $this->makeCallableObject($sComponentId))) |
|
| 356 | + if (!($xCallable = $this->makeCallableObject($sComponentId))) |
|
| 357 | 357 | { |
| 358 | 358 | return null; |
| 359 | 359 | } |
@@ -116,8 +116,7 @@ discard block |
||
| 116 | 116 | public function setLogger(LoggerInterface|Closure $xLogger) |
| 117 | 117 | { |
| 118 | 118 | is_a($xLogger, LoggerInterface::class) ? |
| 119 | - $this->val(LoggerInterface::class, $xLogger) : |
|
| 120 | - $this->set(LoggerInterface::class, $xLogger); |
|
| 119 | + $this->val(LoggerInterface::class, $xLogger) : $this->set(LoggerInterface::class, $xLogger); |
|
| 121 | 120 | } |
| 122 | 121 | |
| 123 | 122 | /** |
@@ -196,7 +195,7 @@ discard block |
||
| 196 | 195 | return $this->xAppContainer != null && $this->xAppContainer->has($sClass) ? |
| 197 | 196 | $this->xAppContainer->get($sClass) : $this->xLibContainer->offsetGet($sClass); |
| 198 | 197 | } |
| 199 | - catch(Throwable $e) |
|
| 198 | + catch (Throwable $e) |
|
| 200 | 199 | { |
| 201 | 200 | $xLogger = $this->g(LoggerInterface::class); |
| 202 | 201 | $xTranslator = $this->g(Translator::class); |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | public function canProcessRequest(): bool |
| 62 | 62 | { |
| 63 | 63 | // Return true if the request plugin was already found |
| 64 | - if($this->xRequestPlugin !== null) |
|
| 64 | + if ($this->xRequestPlugin !== null) |
|
| 65 | 65 | { |
| 66 | 66 | return true; |
| 67 | 67 | } |
@@ -70,9 +70,9 @@ discard block |
||
| 70 | 70 | $xRequest = $this->di->getRequest(); |
| 71 | 71 | |
| 72 | 72 | // Find a plugin to process the request |
| 73 | - foreach($this->xPluginManager->getRequestHandlers() as $sClassName) |
|
| 73 | + foreach ($this->xPluginManager->getRequestHandlers() as $sClassName) |
|
| 74 | 74 | { |
| 75 | - if($sClassName::canProcessRequest($xRequest)) |
|
| 75 | + if ($sClassName::canProcessRequest($xRequest)) |
|
| 76 | 76 | { |
| 77 | 77 | $this->xRequestPlugin = $this->di->g($sClassName); |
| 78 | 78 | $xTarget = $this->xRequestPlugin->setTarget($xRequest); |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | private function _processRequest(): void |
| 93 | 93 | { |
| 94 | 94 | // Process the request |
| 95 | - if($this->xRequestPlugin !== null) |
|
| 95 | + if ($this->xRequestPlugin !== null) |
|
| 96 | 96 | { |
| 97 | 97 | $this->xRequestPlugin->processRequest(); |
| 98 | 98 | // Process the databag |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | $this->di->getBootstrap()->onBoot(); |
| 113 | 113 | |
| 114 | 114 | // Check if there is a plugin to process this request |
| 115 | - if(!$this->canProcessRequest()) |
|
| 115 | + if (!$this->canProcessRequest()) |
|
| 116 | 116 | { |
| 117 | 117 | return; |
| 118 | 118 | } |
@@ -121,11 +121,11 @@ discard block |
||
| 121 | 121 | { |
| 122 | 122 | $bEndRequest = false; |
| 123 | 123 | // Handle before processing event |
| 124 | - if($this->xRequestPlugin !== null) |
|
| 124 | + if ($this->xRequestPlugin !== null) |
|
| 125 | 125 | { |
| 126 | 126 | $this->xCallbackManager->onBefore($this->xRequestPlugin->getTarget(), $bEndRequest); |
| 127 | 127 | } |
| 128 | - if($bEndRequest) |
|
| 128 | + if ($bEndRequest) |
|
| 129 | 129 | { |
| 130 | 130 | return; |
| 131 | 131 | } |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | $this->_processRequest(); |
| 134 | 134 | |
| 135 | 135 | // Handle after processing event |
| 136 | - if($this->xRequestPlugin !== null) |
|
| 136 | + if ($this->xRequestPlugin !== null) |
|
| 137 | 137 | { |
| 138 | 138 | $this->xCallbackManager->onAfter($this->xRequestPlugin->getTarget(), $bEndRequest); |
| 139 | 139 | } |
@@ -141,12 +141,12 @@ discard block |
||
| 141 | 141 | // An exception was thrown while processing the request. |
| 142 | 142 | // The request missed the corresponding handler function, |
| 143 | 143 | // or an error occurred while attempting to execute the handler. |
| 144 | - catch(RequestException $e) |
|
| 144 | + catch (RequestException $e) |
|
| 145 | 145 | { |
| 146 | 146 | $this->xResponseManager->error($e->getMessage()); |
| 147 | 147 | $this->xCallbackManager->onInvalid($e); |
| 148 | 148 | } |
| 149 | - catch(Exception $e) |
|
| 149 | + catch (Exception $e) |
|
| 150 | 150 | { |
| 151 | 151 | $this->xResponseManager->error($e->getMessage()); |
| 152 | 152 | $this->xCallbackManager->onError($e); |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | */ |
| 110 | 110 | public function addCodeGenerator(string $sClassName, int $nPriority): void |
| 111 | 111 | { |
| 112 | - while(isset($this->aCodeGenerators[$nPriority])) |
|
| 112 | + while (isset($this->aCodeGenerators[$nPriority])) |
|
| 113 | 113 | { |
| 114 | 114 | $nPriority++; |
| 115 | 115 | } |
@@ -162,33 +162,33 @@ discard block |
||
| 162 | 162 | */ |
| 163 | 163 | private function generatePluginCodes(CodeGeneratorInterface $xGenerator): void |
| 164 | 164 | { |
| 165 | - if(!is_subclass_of($xGenerator, AbstractPlugin::class) || |
|
| 165 | + if (!is_subclass_of($xGenerator, AbstractPlugin::class) || |
|
| 166 | 166 | $this->xAssetManager->shallIncludeAssets($xGenerator)) |
| 167 | 167 | { |
| 168 | 168 | // HTML tags for CSS |
| 169 | - if(($sCss = trim($xGenerator->getCss(), " \n")) !== '') |
|
| 169 | + if (($sCss = trim($xGenerator->getCss(), " \n")) !== '') |
|
| 170 | 170 | { |
| 171 | 171 | $this->aCss[] = $sCss; |
| 172 | 172 | } |
| 173 | 173 | // HTML tags for js |
| 174 | - if(($sJs = trim($xGenerator->getJs(), " \n")) !== '') |
|
| 174 | + if (($sJs = trim($xGenerator->getJs(), " \n")) !== '') |
|
| 175 | 175 | { |
| 176 | 176 | $this->aJs[] = $sJs; |
| 177 | 177 | } |
| 178 | 178 | } |
| 179 | 179 | |
| 180 | 180 | // Additional js codes |
| 181 | - if(($xJsCode = $xGenerator->getJsCode()) !== null) |
|
| 181 | + if (($xJsCode = $xGenerator->getJsCode()) !== null) |
|
| 182 | 182 | { |
| 183 | - if(($sJs = trim($xJsCode->sJs, " \n")) !== '') |
|
| 183 | + if (($sJs = trim($xJsCode->sJs, " \n")) !== '') |
|
| 184 | 184 | { |
| 185 | 185 | $this->aCodeJs[] = $sJs; |
| 186 | 186 | } |
| 187 | - if(($sJsBefore = trim($xJsCode->sJsBefore, " \n")) !== '') |
|
| 187 | + if (($sJsBefore = trim($xJsCode->sJsBefore, " \n")) !== '') |
|
| 188 | 188 | { |
| 189 | 189 | $this->aCodeJsBefore[] = $sJsBefore; |
| 190 | 190 | } |
| 191 | - if(($sJsAfter = trim($xJsCode->sJsAfter, " \n")) !== '') |
|
| 191 | + if (($sJsAfter = trim($xJsCode->sJsAfter, " \n")) !== '') |
|
| 192 | 192 | { |
| 193 | 193 | $this->aCodeJsAfter[] = $sJsAfter; |
| 194 | 194 | } |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | */ |
| 205 | 205 | private function generateCodes(): void |
| 206 | 206 | { |
| 207 | - if($this->bGenerated) |
|
| 207 | + if ($this->bGenerated) |
|
| 208 | 208 | { |
| 209 | 209 | return; |
| 210 | 210 | } |
@@ -219,7 +219,7 @@ discard block |
||
| 219 | 219 | $this->xAssetManager = $this->di->getAssetManager(); |
| 220 | 220 | |
| 221 | 221 | $this->sJsOptions = $this->xAssetManager->getJsOptions(); |
| 222 | - foreach($this->aCodeGenerators as $sClassName) |
|
| 222 | + foreach ($this->aCodeGenerators as $sClassName) |
|
| 223 | 223 | { |
| 224 | 224 | $this->generatePluginCodes($this->getCodeGenerator($sClassName)); |
| 225 | 225 | } |
@@ -265,11 +265,11 @@ discard block |
||
| 265 | 265 | public function getJsScript(): string |
| 266 | 266 | { |
| 267 | 267 | $aJsScripts = []; |
| 268 | - foreach($this->aCodeGenerators as $sClassName) |
|
| 268 | + foreach ($this->aCodeGenerators as $sClassName) |
|
| 269 | 269 | { |
| 270 | 270 | $xGenerator = $this->getCodeGenerator($sClassName); |
| 271 | 271 | // Javascript code |
| 272 | - if(($sJsScript = trim($xGenerator->getScript(), " \n")) !== '') |
|
| 272 | + if (($sJsScript = trim($xGenerator->getScript(), " \n")) !== '') |
|
| 273 | 273 | { |
| 274 | 274 | $aJsScripts[] = $sJsScript; |
| 275 | 275 | } |
@@ -286,38 +286,36 @@ discard block |
||
| 286 | 286 | private function renderCodes(bool $bIncludeJs, bool $bIncludeCss): array |
| 287 | 287 | { |
| 288 | 288 | $aCodes = []; |
| 289 | - if($bIncludeCss) |
|
| 289 | + if ($bIncludeCss) |
|
| 290 | 290 | { |
| 291 | 291 | $aCodes[] = $this->getCss(); |
| 292 | 292 | } |
| 293 | - if($bIncludeJs) |
|
| 293 | + if ($bIncludeJs) |
|
| 294 | 294 | { |
| 295 | 295 | $aCodes[] = $this->getJs(); |
| 296 | 296 | } |
| 297 | 297 | |
| 298 | - $sUrl = !$this->xAssetManager->shallCreateJsFiles() ? '' : |
|
| 299 | - $this->xAssetManager->createJsFiles($this); |
|
| 298 | + $sUrl = !$this->xAssetManager->shallCreateJsFiles() ? '' : $this->xAssetManager->createJsFiles($this); |
|
| 300 | 299 | // Wrap the js code into the corresponding HTML tag. |
| 301 | 300 | $aCodes[] = $sUrl !== '' ? |
| 302 | - $this->render('include.js', ['sUrl' => $sUrl]) : |
|
| 303 | - $this->render('wrapper.js', ['sScript' => $this->getJsScript()]); |
|
| 301 | + $this->render('include.js', ['sUrl' => $sUrl]) : $this->render('wrapper.js', ['sScript' => $this->getJsScript()]); |
|
| 304 | 302 | |
| 305 | 303 | // Wrap the js codes into HTML tags. |
| 306 | - if(count($this->aCodeJsBefore) > 0) |
|
| 304 | + if (count($this->aCodeJsBefore) > 0) |
|
| 307 | 305 | { |
| 308 | 306 | $sScript = implode("\n\n", $this->aCodeJsBefore); |
| 309 | 307 | $aCodes[] = $this->render('wrapper.js', ['sScript' => $sScript]); |
| 310 | 308 | } |
| 311 | - if(count($this->aCodeJs) > 0) |
|
| 309 | + if (count($this->aCodeJs) > 0) |
|
| 312 | 310 | { |
| 313 | 311 | $sScript = implode("\n\n", $this->aCodeJs); |
| 314 | 312 | $aCodes[] = $this->render('wrapper.js', ['sScript' => $sScript]); |
| 315 | 313 | } |
| 316 | - if(count($this->aCodeJsFiles) > 0) |
|
| 314 | + if (count($this->aCodeJsFiles) > 0) |
|
| 317 | 315 | { |
| 318 | 316 | $aCodes[] = $this->render('includes.js', ['aUrls' => $this->aCodeJsFiles]); |
| 319 | 317 | } |
| 320 | - if(count($this->aCodeJsAfter) > 0) |
|
| 318 | + if (count($this->aCodeJsAfter) > 0) |
|
| 321 | 319 | { |
| 322 | 320 | $sScript = implode("\n\n", $this->aCodeJsAfter); |
| 323 | 321 | $aCodes[] = $this->render('wrapper.js', ['sScript' => $sScript]); |
@@ -82,15 +82,15 @@ discard block |
||
| 82 | 82 | */ |
| 83 | 83 | public function checkOptions(string $sCallable, $xOptions): array |
| 84 | 84 | { |
| 85 | - if(!$this->xValidator->validateClass(trim($sCallable))) |
|
| 85 | + if (!$this->xValidator->validateClass(trim($sCallable))) |
|
| 86 | 86 | { |
| 87 | 87 | throw new SetupException($this->xTranslator->trans('errors.objects.invalid-declaration')); |
| 88 | 88 | } |
| 89 | - if(is_string($xOptions)) |
|
| 89 | + if (is_string($xOptions)) |
|
| 90 | 90 | { |
| 91 | 91 | $xOptions = ['include' => $xOptions]; |
| 92 | 92 | } |
| 93 | - elseif(!is_array($xOptions)) |
|
| 93 | + elseif (!is_array($xOptions)) |
|
| 94 | 94 | { |
| 95 | 95 | throw new SetupException($this->xTranslator->trans('errors.objects.invalid-declaration')); |
| 96 | 96 | } |
@@ -135,15 +135,15 @@ discard block |
||
| 135 | 135 | private function addCallable(CallableObject $xCallableObject): void |
| 136 | 136 | { |
| 137 | 137 | $aCallableMethods = $xCallableObject->getCallableMethods(); |
| 138 | - if($xCallableObject->excluded() || count($aCallableMethods) === 0) |
|
| 138 | + if ($xCallableObject->excluded() || count($aCallableMethods) === 0) |
|
| 139 | 139 | { |
| 140 | 140 | return; |
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | $aCallableObject = &$this->aCallableObjects; |
| 144 | - foreach(explode('.', $xCallableObject->getJsName()) as $sName) |
|
| 144 | + foreach (explode('.', $xCallableObject->getJsName()) as $sName) |
|
| 145 | 145 | { |
| 146 | - if(!isset($aCallableObject['children'][$sName])) |
|
| 146 | + if (!isset($aCallableObject['children'][$sName])) |
|
| 147 | 147 | { |
| 148 | 148 | $aCallableObject['children'][$sName] = []; |
| 149 | 149 | } |
@@ -161,12 +161,11 @@ discard block |
||
| 161 | 161 | private function renderMethod(string $sIndent, array $aTemplateVars): string |
| 162 | 162 | { |
| 163 | 163 | $aOptions = []; |
| 164 | - foreach($aTemplateVars['aMethod']['options'] as $sKey => $sValue) |
|
| 164 | + foreach ($aTemplateVars['aMethod']['options'] as $sKey => $sValue) |
|
| 165 | 165 | { |
| 166 | 166 | $aOptions[] = "$sKey: $sValue"; |
| 167 | 167 | } |
| 168 | - $aTemplateVars['sArguments'] = count($aOptions) === 0 ? 'args' : |
|
| 169 | - 'args, { ' . implode(',', $aOptions) . ' }'; |
|
| 168 | + $aTemplateVars['sArguments'] = count($aOptions) === 0 ? 'args' : 'args, { ' . implode(',', $aOptions) . ' }'; |
|
| 170 | 169 | |
| 171 | 170 | return $sIndent . trim($this->xTemplateEngine |
| 172 | 171 | ->render('jaxon::callables/method.js', $aTemplateVars)); |
@@ -186,11 +185,10 @@ discard block |
||
| 186 | 185 | |
| 187 | 186 | $fMethodCallback = fn($aMethod) => $this->renderMethod($sIndent, |
| 188 | 187 | ['sJsClass' => $sJsClass, 'aMethod' => $aMethod]); |
| 189 | - $aMethods = !isset($aCallable['methods']) ? [] : |
|
| 190 | - array_map($fMethodCallback, $aCallable['methods']); |
|
| 188 | + $aMethods = !isset($aCallable['methods']) ? [] : array_map($fMethodCallback, $aCallable['methods']); |
|
| 191 | 189 | |
| 192 | 190 | $aChildren = []; |
| 193 | - foreach($aCallable['children'] ?? [] as $sName => $aChild) |
|
| 191 | + foreach ($aCallable['children'] ?? [] as $sName => $aChild) |
|
| 194 | 192 | { |
| 195 | 193 | $aChildren[] = $this->renderChild("$sName:", "$sJsClass.$sName", |
| 196 | 194 | $aChild, $nRepeat) . ','; |
@@ -231,13 +229,13 @@ discard block |
||
| 231 | 229 | $this->xRegistry->registerAllComponents(); |
| 232 | 230 | |
| 233 | 231 | $this->aCallableObjects = ['children' => []]; |
| 234 | - foreach($this->cdi->getCallableObjects() as $xCallableObject) |
|
| 232 | + foreach ($this->cdi->getCallableObjects() as $xCallableObject) |
|
| 235 | 233 | { |
| 236 | 234 | $this->addCallable($xCallableObject); |
| 237 | 235 | } |
| 238 | 236 | |
| 239 | 237 | $aScripts = []; |
| 240 | - foreach($this->aCallableObjects['children'] as $sJsClass => $aCallable) |
|
| 238 | + foreach ($this->aCallableObjects['children'] as $sJsClass => $aCallable) |
|
| 241 | 239 | { |
| 242 | 240 | $aScripts[] = $this->renderChild("{$this->sPrefix}$sJsClass =", |
| 243 | 241 | $sJsClass, $aCallable) . ';'; |
@@ -293,7 +291,7 @@ discard block |
||
| 293 | 291 | // Will be used to print a translated error message. |
| 294 | 292 | $aErrorParams = ['class' => $sClassName, 'method' => $sMethodName]; |
| 295 | 293 | |
| 296 | - if(!$this->xValidator->validateJsObject($sClassName) || |
|
| 294 | + if (!$this->xValidator->validateJsObject($sClassName) || |
|
| 297 | 295 | !$this->xValidator->validateMethod($sMethodName)) |
| 298 | 296 | { |
| 299 | 297 | // Unable to find the requested object or method |
@@ -307,7 +305,7 @@ discard block |
||
| 307 | 305 | /** @var CallableObject */ |
| 308 | 306 | $xCallableObject = $this->getCallable($sClassName); |
| 309 | 307 | |
| 310 | - if($xCallableObject->excluded($sMethodName)) |
|
| 308 | + if ($xCallableObject->excluded($sMethodName)) |
|
| 311 | 309 | { |
| 312 | 310 | // Unable to find the requested class or method |
| 313 | 311 | $this->throwException('', 'errors.objects.excluded', $aErrorParams); |
@@ -316,7 +314,7 @@ discard block |
||
| 316 | 314 | $sError = 'errors.objects.call'; |
| 317 | 315 | $xCallableObject->call($this->xTarget); |
| 318 | 316 | } |
| 319 | - catch(ReflectionException|SetupException $e) |
|
| 317 | + catch (ReflectionException|SetupException $e) |
|
| 320 | 318 | { |
| 321 | 319 | // Unable to execute the requested class or method |
| 322 | 320 | $this->throwException($e->getMessage(), $sError, $aErrorParams); |
@@ -10,24 +10,24 @@ |
||
| 10 | 10 | jxn.config.defaultMethod = '<?php echo $this->sDefaultMethod ?>'; |
| 11 | 11 | jxn.config.responseType = '<?php echo $this->sResponseType ?>'; |
| 12 | 12 | |
| 13 | -<?php if($this->nResponseQueueSize > 0): ?> |
|
| 13 | +<?php if ($this->nResponseQueueSize > 0): ?> |
|
| 14 | 14 | jxn.config.responseQueueSize = <?php echo $this->nResponseQueueSize ?>; |
| 15 | 15 | <?php endif ?> |
| 16 | 16 | |
| 17 | -<?php if($this->bLoggingEnabled): ?> |
|
| 17 | +<?php if ($this->bLoggingEnabled): ?> |
|
| 18 | 18 | jxn.debug.logger = '<?php echo Jaxon\rq(Jaxon\App\Component\Logger::class)->_class() ?>'; |
| 19 | 19 | <?php endif ?> |
| 20 | 20 | |
| 21 | -<?php if($this->bDebug): ?> |
|
| 21 | +<?php if ($this->bDebug): ?> |
|
| 22 | 22 | jxn.debug.active = true; |
| 23 | -<?php if($this->sDebugOutputID): ?> |
|
| 23 | +<?php if ($this->sDebugOutputID): ?> |
|
| 24 | 24 | jxn.debug.outputID = '<?php echo $this->sDebugOutputID ?>'; |
| 25 | 25 | <?php endif ?> |
| 26 | -<?php if($this->bVerboseDebug): ?> |
|
| 26 | +<?php if ($this->bVerboseDebug): ?> |
|
| 27 | 27 | jxn.debug.verbose.active = true; |
| 28 | 28 | <?php endif ?> |
| 29 | 29 | <?php endif ?> |
| 30 | 30 | |
| 31 | -<?php if($this->sCsrfMetaName): ?> |
|
| 31 | +<?php if ($this->sCsrfMetaName): ?> |
|
| 32 | 32 | jxn.setCsrf('<?php echo $this->sCsrfMetaName ?>'); |
| 33 | 33 | <?php endif ?> |