@@ -1,4 +1,4 @@ |
||
| 1 | -<?php if(($this->sScript)): ?> |
|
| 1 | +<?php if (($this->sScript)): ?> |
|
| 2 | 2 | jaxon.dom.ready(function() { |
| 3 | 3 | <?php echo $this->sScript ?> |
| 4 | 4 | }); |
@@ -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 ?> |
@@ -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; |
@@ -1,13 +1,13 @@ |
||
| 1 | 1 | <ul class="pagination"><?php |
| 2 | - if(($this->prev)) |
|
| 2 | + if (($this->prev)) |
|
| 3 | 3 | { |
| 4 | 4 | echo $this->prev; |
| 5 | 5 | } |
| 6 | - foreach($this->links as $link) |
|
| 6 | + foreach ($this->links as $link) |
|
| 7 | 7 | { |
| 8 | 8 | echo $link; |
| 9 | 9 | } |
| 10 | - if(($this->next)) |
|
| 10 | + if (($this->next)) |
|
| 11 | 11 | { |
| 12 | 12 | echo $this->next; |
| 13 | 13 | } |
@@ -48,7 +48,7 @@ |
||
| 48 | 48 | $sViewName = $store->getViewName(); |
| 49 | 49 | $sNamespace = $store->getNamespace(); |
| 50 | 50 | // In this view renderer, the namespace must always be prepended to the view name. |
| 51 | - if(substr($sViewName, 0, strlen($sNamespace) + 2) != $sNamespace . '::') |
|
| 51 | + if (substr($sViewName, 0, strlen($sNamespace) + 2) != $sNamespace . '::') |
|
| 52 | 52 | { |
| 53 | 53 | $sViewName = $sNamespace . '::' . $sViewName; |
| 54 | 54 | } |
@@ -72,7 +72,7 @@ |
||
| 72 | 72 | // and the other classes will get this request from there. |
| 73 | 73 | $this->di->val(ServerRequestInterface::class, $request); |
| 74 | 74 | |
| 75 | - if(!$this->xRequestHandler->canProcessRequest()) |
|
| 75 | + if (!$this->xRequestHandler->canProcessRequest()) |
|
| 76 | 76 | { |
| 77 | 77 | // Unable to find a plugin to process the request |
| 78 | 78 | throw new RequestException($this->xTranslator->trans('errors.request.plugin')); |
@@ -64,7 +64,7 @@ |
||
| 64 | 64 | // and the other classes will get this request from there. |
| 65 | 65 | $this->di->val(ServerRequestInterface::class, $request); |
| 66 | 66 | |
| 67 | - if(!$this->xRequestHandler->canProcessRequest()) |
|
| 67 | + if (!$this->xRequestHandler->canProcessRequest()) |
|
| 68 | 68 | { |
| 69 | 69 | // Unable to find a plugin to process the request |
| 70 | 70 | return $handler->handle($request); |
@@ -114,15 +114,15 @@ |
||
| 114 | 114 | { |
| 115 | 115 | switch($sName) |
| 116 | 116 | { |
| 117 | - case 'class': // The user function is a method in the given class |
|
| 118 | - $this->xPhpFunction = [$sValue, $this->xPhpFunction]; |
|
| 119 | - break; |
|
| 120 | - case 'include': |
|
| 121 | - $this->sInclude = $sValue; |
|
| 122 | - break; |
|
| 123 | - default: |
|
| 124 | - $this->aOptions[$sName] = $sValue; |
|
| 125 | - break; |
|
| 117 | + case 'class': // The user function is a method in the given class |
|
| 118 | + $this->xPhpFunction = [$sValue, $this->xPhpFunction]; |
|
| 119 | + break; |
|
| 120 | + case 'include': |
|
| 121 | + $this->sInclude = $sValue; |
|
| 122 | + break; |
|
| 123 | + default: |
|
| 124 | + $this->aOptions[$sName] = $sValue; |
|
| 125 | + break; |
|
| 126 | 126 | } |
| 127 | 127 | } |
| 128 | 128 | |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | */ |
| 124 | 124 | public function configure(string $sName, string $sValue) |
| 125 | 125 | { |
| 126 | - switch($sName) |
|
| 126 | + switch ($sName) |
|
| 127 | 127 | { |
| 128 | 128 | case 'class': // The user function is a method in the given class |
| 129 | 129 | $this->xPhpFunction = [$sValue, $this->xPhpFunction]; |
@@ -147,12 +147,12 @@ discard block |
||
| 147 | 147 | */ |
| 148 | 148 | public function call(array $aArgs = []) |
| 149 | 149 | { |
| 150 | - if(($this->sInclude)) |
|
| 150 | + if (($this->sInclude)) |
|
| 151 | 151 | { |
| 152 | 152 | require_once $this->sInclude; |
| 153 | 153 | } |
| 154 | 154 | // If the function is an alias for a class method, then instantiate the class |
| 155 | - if(is_array($this->xPhpFunction) && is_string($this->xPhpFunction[0])) |
|
| 155 | + if (is_array($this->xPhpFunction) && is_string($this->xPhpFunction[0])) |
|
| 156 | 156 | { |
| 157 | 157 | $sClassName = $this->xPhpFunction[0]; |
| 158 | 158 | $this->xPhpFunction[0] = $this->di->h($sClassName) ? |
@@ -127,8 +127,7 @@ discard block |
||
| 127 | 127 | { |
| 128 | 128 | // Register a function without options |
| 129 | 129 | $this->xPluginManager->registerCallable($sCallableType, $xValue); |
| 130 | - } |
|
| 131 | - elseif(is_string($xKey) && (is_array($xValue) || is_string($xValue))) |
|
| 130 | + } elseif(is_string($xKey) && (is_array($xValue) || is_string($xValue))) |
|
| 132 | 131 | { |
| 133 | 132 | // Register a function with options |
| 134 | 133 | $this->xPluginManager->registerCallable($sCallableType, $xKey, $xValue); |
@@ -175,8 +174,7 @@ discard block |
||
| 175 | 174 | { |
| 176 | 175 | // A string is supposed to be the path to a config file. |
| 177 | 176 | $aLibOptions = $this->xConfigManager->read($aLibOptions); |
| 178 | - } |
|
| 179 | - elseif(!is_array($aLibOptions)) |
|
| 177 | + } elseif(!is_array($aLibOptions)) |
|
| 180 | 178 | { |
| 181 | 179 | // Otherwise, anything else than an array is not accepted. |
| 182 | 180 | $sMessage = $this->xTranslator->trans('errors.register.invalid', ['name' => $sClassName]); |
@@ -63,28 +63,28 @@ discard block |
||
| 63 | 63 | private function updateContainer(Config $xConfig) |
| 64 | 64 | { |
| 65 | 65 | $aOptions = $xConfig->getOption('container.set', []); |
| 66 | - foreach($aOptions as $xKey => $xValue) |
|
| 66 | + foreach ($aOptions as $xKey => $xValue) |
|
| 67 | 67 | { |
| 68 | 68 | // The key is the class name. It must be a string. |
| 69 | - $this->di->set((string)$xKey, $xValue); |
|
| 69 | + $this->di->set((string) $xKey, $xValue); |
|
| 70 | 70 | } |
| 71 | 71 | $aOptions = $xConfig->getOption('container.val', []); |
| 72 | - foreach($aOptions as $xKey => $xValue) |
|
| 72 | + foreach ($aOptions as $xKey => $xValue) |
|
| 73 | 73 | { |
| 74 | 74 | // The key is the class name. It must be a string. |
| 75 | - $this->di->val((string)$xKey, $xValue); |
|
| 75 | + $this->di->val((string) $xKey, $xValue); |
|
| 76 | 76 | } |
| 77 | 77 | $aOptions = $xConfig->getOption('container.auto', []); |
| 78 | - foreach($aOptions as $xValue) |
|
| 78 | + foreach ($aOptions as $xValue) |
|
| 79 | 79 | { |
| 80 | 80 | // The key is the class name. It must be a string. |
| 81 | - $this->di->auto((string)$xValue); |
|
| 81 | + $this->di->auto((string) $xValue); |
|
| 82 | 82 | } |
| 83 | 83 | $aOptions = $xConfig->getOption('container.alias', []); |
| 84 | - foreach($aOptions as $xKey => $xValue) |
|
| 84 | + foreach ($aOptions as $xKey => $xValue) |
|
| 85 | 85 | { |
| 86 | 86 | // The key is the class name. It must be a string. |
| 87 | - $this->di->alias((string)$xKey, (string)$xValue); |
|
| 87 | + $this->di->alias((string) $xKey, (string) $xValue); |
|
| 88 | 88 | } |
| 89 | 89 | } |
| 90 | 90 | |
@@ -99,14 +99,14 @@ discard block |
||
| 99 | 99 | */ |
| 100 | 100 | private function registerCallables(array $aOptions, string $sCallableType) |
| 101 | 101 | { |
| 102 | - foreach($aOptions as $xKey => $xValue) |
|
| 102 | + foreach ($aOptions as $xKey => $xValue) |
|
| 103 | 103 | { |
| 104 | - if(is_integer($xKey) && is_string($xValue)) |
|
| 104 | + if (is_integer($xKey) && is_string($xValue)) |
|
| 105 | 105 | { |
| 106 | 106 | // Register a function without options |
| 107 | 107 | $this->xPluginManager->registerCallable($sCallableType, $xValue); |
| 108 | 108 | } |
| 109 | - elseif(is_string($xKey) && (is_array($xValue) || is_string($xValue))) |
|
| 109 | + elseif (is_string($xKey) && (is_array($xValue) || is_string($xValue))) |
|
| 110 | 110 | { |
| 111 | 111 | // Register a function with options |
| 112 | 112 | $this->xPluginManager->registerCallable($sCallableType, $xKey, $xValue); |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | */ |
| 124 | 124 | private function registerExceptionHandlers(Config $xConfig) |
| 125 | 125 | { |
| 126 | - foreach($xConfig->getOption('exceptions', []) as $sExClass => $xExHandler) |
|
| 126 | + foreach ($xConfig->getOption('exceptions', []) as $sExClass => $xExHandler) |
|
| 127 | 127 | { |
| 128 | 128 | $this->xCallbackManager->error($xExHandler, is_string($sExClass) ? $sExClass : ''); |
| 129 | 129 | } |
@@ -173,12 +173,12 @@ discard block |
||
| 173 | 173 | { |
| 174 | 174 | // $this->aPackages contains packages config file paths. |
| 175 | 175 | $aLibOptions = $sClassName::config(); |
| 176 | - if(is_string($aLibOptions)) |
|
| 176 | + if (is_string($aLibOptions)) |
|
| 177 | 177 | { |
| 178 | 178 | // A string is supposed to be the path to a config file. |
| 179 | 179 | $aLibOptions = $this->xConfigManager->read($aLibOptions); |
| 180 | 180 | } |
| 181 | - elseif(!is_array($aLibOptions)) |
|
| 181 | + elseif (!is_array($aLibOptions)) |
|
| 182 | 182 | { |
| 183 | 183 | // Otherwise, anything else than an array is not accepted. |
| 184 | 184 | $sMessage = $this->xTranslator->trans('errors.register.invalid', ['name' => $sClassName]); |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | { |
| 202 | 202 | $xOptionsProvider = $aUserOptions['provider'] ?? null; |
| 203 | 203 | // The user can provide a callable that returns the package options. |
| 204 | - if(is_callable($xOptionsProvider)) |
|
| 204 | + if (is_callable($xOptionsProvider)) |
|
| 205 | 205 | { |
| 206 | 206 | $aUserOptions = $xOptionsProvider($aUserOptions); |
| 207 | 207 | } |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | public function registerPackage(string $sClassName, array $aUserOptions) |
| 221 | 221 | { |
| 222 | 222 | $sClassName = trim($sClassName, '\\ '); |
| 223 | - if(!is_subclass_of($sClassName, AbstractPackage::class)) |
|
| 223 | + if (!is_subclass_of($sClassName, AbstractPackage::class)) |
|
| 224 | 224 | { |
| 225 | 225 | $sMessage = $this->xTranslator->trans('errors.register.invalid', ['name' => $sClassName]); |
| 226 | 226 | throw new SetupException($sMessage); |
@@ -266,7 +266,7 @@ discard block |
||
| 266 | 266 | |
| 267 | 267 | // Register packages |
| 268 | 268 | $aPackageConfig = $xAppConfig->getOption('packages', []); |
| 269 | - foreach($aPackageConfig as $sClassName => $aPkgOptions) |
|
| 269 | + foreach ($aPackageConfig as $sClassName => $aPkgOptions) |
|
| 270 | 270 | { |
| 271 | 271 | $this->registerPackage($sClassName, $aPkgOptions); |
| 272 | 272 | } |