@@ -6,20 +6,20 @@ |
||
| 6 | 6 | jaxon.config.defaultMethod = "<?php echo $this->sDefaultMethod ?>"; |
| 7 | 7 | jaxon.config.responseType = "<?php echo $this->sResponseType ?>"; |
| 8 | 8 | |
| 9 | -<?php if($this->nResponseQueueSize > 0): ?> |
|
| 9 | +<?php if ($this->nResponseQueueSize > 0): ?> |
|
| 10 | 10 | jaxon.config.responseQueueSize = <?php echo $this->nResponseQueueSize ?>; |
| 11 | 11 | <?php endif ?> |
| 12 | 12 | |
| 13 | -<?php if(($this->bDebug)): ?> |
|
| 13 | +<?php if (($this->bDebug)): ?> |
|
| 14 | 14 | jaxon.debug.active = true; |
| 15 | -<?php if(($this->sDebugOutputID)): ?> |
|
| 15 | +<?php if (($this->sDebugOutputID)): ?> |
|
| 16 | 16 | jaxon.debug.outputID = "<?php echo $this->sDebugOutputID ?>"; |
| 17 | 17 | <?php endif ?> |
| 18 | -<?php if(($this->bVerboseDebug)): ?> |
|
| 18 | +<?php if (($this->bVerboseDebug)): ?> |
|
| 19 | 19 | jaxon.debug.verbose.active = true; |
| 20 | 20 | <?php endif ?> |
| 21 | 21 | <?php endif ?> |
| 22 | 22 | |
| 23 | -<?php if(($this->sCsrfMetaName)): ?> |
|
| 23 | +<?php if (($this->sCsrfMetaName)): ?> |
|
| 24 | 24 | jaxon.setCsrf('<?php echo $this->sCsrfMetaName ?>'); |
| 25 | 25 | <?php endif ?> |
@@ -1,4 +1,4 @@ |
||
| 1 | -<?php if(($this->sScript)): ?> |
|
| 1 | +<?php if (($this->sScript)): ?> |
|
| 2 | 2 | <script type="text/javascript" <?php echo $this->sJsOptions ?> charset="UTF-8"> |
| 3 | 3 | /* <![CDATA[ */ |
| 4 | 4 | <?php echo $this->sScript, "\n" ?> |
@@ -1,3 +1,3 @@ |
||
| 1 | -<?php foreach($this->aUrls as $sUrl): |
|
| 1 | +<?php foreach ($this->aUrls as $sUrl): |
|
| 2 | 2 | $this->include('jaxon::plugins/include.js', ['sUrl' => $sUrl, 'sJsOptions' => $this->sJsOptions]); |
| 3 | 3 | endforeach; |
@@ -237,7 +237,7 @@ |
||
| 237 | 237 | */ |
| 238 | 238 | public function val(string $sKey, $xValue) |
| 239 | 239 | { |
| 240 | - $this->xLibContainer->offsetSet($sKey, $xValue); |
|
| 240 | + $this->xLibContainer->offsetSet($sKey, $xValue); |
|
| 241 | 241 | } |
| 242 | 242 | |
| 243 | 243 | /** |
@@ -120,8 +120,7 @@ discard block |
||
| 120 | 120 | public function setLogger(LoggerInterface|Closure $xLogger) |
| 121 | 121 | { |
| 122 | 122 | is_a($xLogger, LoggerInterface::class) ? |
| 123 | - $this->val(LoggerInterface::class, $xLogger) : |
|
| 124 | - $this->set(LoggerInterface::class, $xLogger); |
|
| 123 | + $this->val(LoggerInterface::class, $xLogger) : $this->set(LoggerInterface::class, $xLogger); |
|
| 125 | 124 | } |
| 126 | 125 | |
| 127 | 126 | /** |
@@ -200,7 +199,7 @@ discard block |
||
| 200 | 199 | return $this->xAppContainer != null && $this->xAppContainer->has($sClass) ? |
| 201 | 200 | $this->xAppContainer->get($sClass) : $this->xLibContainer->offsetGet($sClass); |
| 202 | 201 | } |
| 203 | - catch(Exception|Throwable $e) |
|
| 202 | + catch (Exception|Throwable $e) |
|
| 204 | 203 | { |
| 205 | 204 | $xLogger = $this->g(LoggerInterface::class); |
| 206 | 205 | $xTranslator = $this->g(Translator::class); |
@@ -266,15 +265,15 @@ discard block |
||
| 266 | 265 | { |
| 267 | 266 | $xType = $xParameter->getType(); |
| 268 | 267 | // Check the parameter class first. |
| 269 | - if($xType instanceof ReflectionNamedType) |
|
| 268 | + if ($xType instanceof ReflectionNamedType) |
|
| 270 | 269 | { |
| 271 | 270 | // Check the class + the name |
| 272 | - if($this->has($xType->getName() . ' $' . $xParameter->getName())) |
|
| 271 | + if ($this->has($xType->getName() . ' $' . $xParameter->getName())) |
|
| 273 | 272 | { |
| 274 | 273 | return $this->get($xType->getName() . ' $' . $xParameter->getName()); |
| 275 | 274 | } |
| 276 | 275 | // Check the class only |
| 277 | - if($this->has($xType->getName())) |
|
| 276 | + if ($this->has($xType->getName())) |
|
| 278 | 277 | { |
| 279 | 278 | return $this->get($xType->getName()); |
| 280 | 279 | } |
@@ -199,8 +199,7 @@ |
||
| 199 | 199 | { |
| 200 | 200 | return $this->xAppContainer != null && $this->xAppContainer->has($sClass) ? |
| 201 | 201 | $this->xAppContainer->get($sClass) : $this->xLibContainer->offsetGet($sClass); |
| 202 | - } |
|
| 203 | - catch(Exception|Throwable $e) |
|
| 202 | + } catch(Exception|Throwable $e) |
|
| 204 | 203 | { |
| 205 | 204 | $xLogger = $this->g(LoggerInterface::class); |
| 206 | 205 | $xTranslator = $this->g(Translator::class); |
@@ -37,7 +37,6 @@ |
||
| 37 | 37 | public function getMetadataReader(string $sReaderId): MetadataReaderInterface |
| 38 | 38 | { |
| 39 | 39 | return $this->h("metadata_reader_$sReaderId") ? |
| 40 | - $this->g("metadata_reader_$sReaderId") : |
|
| 41 | - $this->g('metadata_reader_null'); |
|
| 40 | + $this->g("metadata_reader_$sReaderId") : $this->g('metadata_reader_null'); |
|
| 42 | 41 | } |
| 43 | 42 | } |
@@ -42,13 +42,13 @@ |
||
| 42 | 42 | */ |
| 43 | 43 | public function make(string|ReflectionClass $xClass): mixed |
| 44 | 44 | { |
| 45 | - if(is_string($xClass)) |
|
| 45 | + if (is_string($xClass)) |
|
| 46 | 46 | { |
| 47 | 47 | // Create the reflection class instance |
| 48 | 48 | $xClass = new ReflectionClass($xClass); |
| 49 | 49 | } |
| 50 | 50 | // Use the Reflection class to get the parameters of the constructor |
| 51 | - if(($constructor = $xClass->getConstructor()) === null) |
|
| 51 | + if (($constructor = $xClass->getConstructor()) === null) |
|
| 52 | 52 | { |
| 53 | 53 | return $xClass->newInstance(); |
| 54 | 54 | } |
@@ -58,8 +58,7 @@ |
||
| 58 | 58 | $xParameterReader = $di->g(ParameterReader::class); |
| 59 | 59 | $xRequest = $di->g(ServerRequestInterface::class); |
| 60 | 60 | $aRequestParameter = $xParameterReader->getRequestParameter($xRequest); |
| 61 | - return !is_array($aRequestParameter) ? $xRequest : |
|
| 62 | - $xRequest->withAttribute('jxncall', $aRequestParameter); |
|
| 61 | + return !is_array($aRequestParameter) ? $xRequest : $xRequest->withAttribute('jxncall', $aRequestParameter); |
|
| 63 | 62 | }); |
| 64 | 63 | // PSR factory |
| 65 | 64 | $this->set(PsrFactory::class, function($di) { |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | public function registerPackage(string $sClassName, array $aUserOptions): void |
| 194 | 194 | { |
| 195 | 195 | // Register the user class, but only if the user didn't already. |
| 196 | - if(!$this->h($sClassName)) |
|
| 196 | + if (!$this->h($sClassName)) |
|
| 197 | 197 | { |
| 198 | 198 | $this->set($sClassName, fn() => $this->make($sClassName)); |
| 199 | 199 | } |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | $this->set($sConfigKey, function($di) use($aUserOptions) { |
| 204 | 204 | $xOptionsProvider = $aUserOptions['provider'] ?? null; |
| 205 | 205 | // The user can provide a callable that returns the package options. |
| 206 | - if(is_callable($xOptionsProvider)) |
|
| 206 | + if (is_callable($xOptionsProvider)) |
|
| 207 | 207 | { |
| 208 | 208 | $aUserOptions = $xOptionsProvider($aUserOptions); |
| 209 | 209 | } |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | */ |
| 187 | 187 | private function getCommandArgs(array|JsonSerializable $aArgs, bool $bRemoveEmpty = false): array |
| 188 | 188 | { |
| 189 | - if(!$bRemoveEmpty) |
|
| 189 | + if (!$bRemoveEmpty) |
|
| 190 | 190 | { |
| 191 | 191 | return $aArgs; |
| 192 | 192 | } |
@@ -211,7 +211,7 @@ discard block |
||
| 211 | 211 | 'name' => $this->str($sName), |
| 212 | 212 | 'args' => $this->getCommandArgs($aArgs, $bRemoveEmpty), |
| 213 | 213 | ]); |
| 214 | - if($this->bOnConfirm) |
|
| 214 | + if ($this->bOnConfirm) |
|
| 215 | 215 | { |
| 216 | 216 | $this->aConfirmCommands[] = $xCommand; |
| 217 | 217 | } |
@@ -240,14 +240,14 @@ discard block |
||
| 240 | 240 | public function addConfirmCommand(string $sName, Closure $fConfirm, |
| 241 | 241 | string $sQuestion, array $aArgs = []): self |
| 242 | 242 | { |
| 243 | - if($this->bOnConfirm) |
|
| 243 | + if ($this->bOnConfirm) |
|
| 244 | 244 | { |
| 245 | 245 | throw new AppException($this->xTranslator->trans('errors.app.confirm.nested')); |
| 246 | 246 | } |
| 247 | 247 | $this->bOnConfirm = true; |
| 248 | 248 | $fConfirm(); |
| 249 | 249 | $this->bOnConfirm = false; |
| 250 | - if(($nCommandCount = count($this->aConfirmCommands)) > 0) |
|
| 250 | + if (($nCommandCount = count($this->aConfirmCommands)) > 0) |
|
| 251 | 251 | { |
| 252 | 252 | $aCommand = $this->di->getDialogCommand()->confirm($this->str($sQuestion), $aArgs); |
| 253 | 253 | $aCommand['count'] = $nCommandCount; |
@@ -354,7 +354,7 @@ discard block |
||
| 354 | 354 | */ |
| 355 | 355 | public function printDebug() |
| 356 | 356 | { |
| 357 | - foreach($this->aDebugMessages as $sMessage) |
|
| 357 | + foreach ($this->aDebugMessages as $sMessage) |
|
| 358 | 358 | { |
| 359 | 359 | $this->addCommand('script.debug', ['message' => $this->str($sMessage)]); |
| 360 | 360 | } |
@@ -368,8 +368,7 @@ discard block |
||
| 368 | 368 | */ |
| 369 | 369 | public function getContentType(): string |
| 370 | 370 | { |
| 371 | - return empty($this->sCharacterEncoding) ? $this->getResponse()->getContentType() : |
|
| 372 | - $this->getResponse()->getContentType() . '; charset="' . $this->sCharacterEncoding . '"'; |
|
| 371 | + return empty($this->sCharacterEncoding) ? $this->getResponse()->getContentType() : $this->getResponse()->getContentType() . '; charset="' . $this->sCharacterEncoding . '"'; |
|
| 373 | 372 | } |
| 374 | 373 | |
| 375 | 374 | /** |
@@ -214,8 +214,7 @@ |
||
| 214 | 214 | if($this->bOnConfirm) |
| 215 | 215 | { |
| 216 | 216 | $this->aConfirmCommands[] = $xCommand; |
| 217 | - } |
|
| 218 | - else |
|
| 217 | + } else |
|
| 219 | 218 | { |
| 220 | 219 | $this->aCommands[] = $xCommand; |
| 221 | 220 | } |