@@ -63,12 +63,10 @@ |
||
| 63 | 63 | if(!$sPath) |
| 64 | 64 | { |
| 65 | 65 | $this->sPath = "$jQueryNs(this)"; // If an empty selector is given, use javascript "this" instead |
| 66 | - } |
|
| 67 | - elseif(($sContext)) |
|
| 66 | + } elseif(($sContext)) |
|
| 68 | 67 | { |
| 69 | 68 | $this->sPath = "$jQueryNs('" . $sPath . "', $jQueryNs('" . $sContext . "'))"; |
| 70 | - } |
|
| 71 | - else |
|
| 69 | + } else |
|
| 72 | 70 | { |
| 73 | 71 | $this->sPath = "$jQueryNs('" . $sPath . "')"; |
| 74 | 72 | } |
@@ -67,11 +67,11 @@ discard block |
||
| 67 | 67 | $sContext = trim($sContext, " \t"); |
| 68 | 68 | $this->aCalls = []; |
| 69 | 69 | |
| 70 | - if(!$sPath) |
|
| 70 | + if (!$sPath) |
|
| 71 | 71 | { |
| 72 | 72 | $this->sPath = "$jQueryNs(this)"; // If an empty selector is given, use javascript "this" instead |
| 73 | 73 | } |
| 74 | - elseif(($sContext)) |
|
| 74 | + elseif (($sContext)) |
|
| 75 | 75 | { |
| 76 | 76 | $this->sPath = "$jQueryNs('" . $sPath . "', $jQueryNs('" . $sContext . "'))"; |
| 77 | 77 | } |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | public function getScript(): string |
| 146 | 146 | { |
| 147 | 147 | $sScript = $this->sPath; |
| 148 | - if(count($this->aCalls) > 0) |
|
| 148 | + if (count($this->aCalls) > 0) |
|
| 149 | 149 | { |
| 150 | 150 | $sScript .= '.' . implode('.', $this->aCalls); |
| 151 | 151 | } |
@@ -87,7 +87,7 @@ |
||
| 87 | 87 | public function selector(string $sPath = '', string $sContext = ''): DomSelector |
| 88 | 88 | { |
| 89 | 89 | $xSelector = new DomSelector($this->jQueryNs, $sPath, $sContext); |
| 90 | - if($this->bCommand && $this->response() !== null) |
|
| 90 | + if ($this->bCommand && $this->response() !== null) |
|
| 91 | 91 | { |
| 92 | 92 | $this->addCommand(['cmd' => 'jquery'], $xSelector); |
| 93 | 93 | } |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | */ |
| 105 | 105 | public function addCodeGenerator(string $sClassName, int $nPriority) |
| 106 | 106 | { |
| 107 | - while(isset($this->aCodeGenerators[$nPriority])) |
|
| 107 | + while (isset($this->aCodeGenerators[$nPriority])) |
|
| 108 | 108 | { |
| 109 | 109 | $nPriority++; |
| 110 | 110 | } |
@@ -152,28 +152,28 @@ discard block |
||
| 152 | 152 | { |
| 153 | 153 | $bIsUsed = false; |
| 154 | 154 | $aInterfaces = class_implements($sClassName); |
| 155 | - if(in_array(CodeGeneratorInterface::class, $aInterfaces)) |
|
| 155 | + if (in_array(CodeGeneratorInterface::class, $aInterfaces)) |
|
| 156 | 156 | { |
| 157 | 157 | $this->addCodeGenerator($sClassName, $nPriority); |
| 158 | 158 | $bIsUsed = true; |
| 159 | 159 | } |
| 160 | - if(in_array(CallableRegistryInterface::class, $aInterfaces)) |
|
| 160 | + if (in_array(CallableRegistryInterface::class, $aInterfaces)) |
|
| 161 | 161 | { |
| 162 | 162 | $this->aRegistryPlugins[$sPluginName] = $sClassName; |
| 163 | 163 | $bIsUsed = true; |
| 164 | 164 | } |
| 165 | - if(in_array(RequestHandlerInterface::class, $aInterfaces)) |
|
| 165 | + if (in_array(RequestHandlerInterface::class, $aInterfaces)) |
|
| 166 | 166 | { |
| 167 | 167 | $this->aRequestHandlers[$sPluginName] = $sClassName; |
| 168 | 168 | $bIsUsed = true; |
| 169 | 169 | } |
| 170 | - if(in_array(ResponsePluginInterface::class, $aInterfaces)) |
|
| 170 | + if (in_array(ResponsePluginInterface::class, $aInterfaces)) |
|
| 171 | 171 | { |
| 172 | 172 | $this->aResponsePlugins[$sPluginName] = $sClassName; |
| 173 | 173 | $bIsUsed = true; |
| 174 | 174 | } |
| 175 | 175 | |
| 176 | - if(!$bIsUsed) |
|
| 176 | + if (!$bIsUsed) |
|
| 177 | 177 | { |
| 178 | 178 | // The class is invalid. |
| 179 | 179 | $sMessage = $this->xTranslator->trans('errors.register.invalid', ['name' => $sClassName]); |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | } |
| 182 | 182 | |
| 183 | 183 | // Register the plugin in the DI container, if necessary |
| 184 | - if(!$this->di->has($sClassName)) |
|
| 184 | + if (!$this->di->has($sClassName)) |
|
| 185 | 185 | { |
| 186 | 186 | $this->di->auto($sClassName); |
| 187 | 187 | } |
@@ -197,12 +197,12 @@ discard block |
||
| 197 | 197 | */ |
| 198 | 198 | public function getResponsePlugin(string $sName, ?Response $xResponse = null): ?ResponsePlugin |
| 199 | 199 | { |
| 200 | - if(!isset($this->aResponsePlugins[$sName])) |
|
| 200 | + if (!isset($this->aResponsePlugins[$sName])) |
|
| 201 | 201 | { |
| 202 | 202 | return null; |
| 203 | 203 | } |
| 204 | 204 | $xPlugin = $this->di->g($this->aResponsePlugins[$sName]); |
| 205 | - if(($xResponse)) |
|
| 205 | + if (($xResponse)) |
|
| 206 | 206 | { |
| 207 | 207 | $xPlugin->setResponse($xResponse); |
| 208 | 208 | } |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | */ |
| 224 | 224 | public function registerCallable(string $sType, string $sCallable, $xOptions = []) |
| 225 | 225 | { |
| 226 | - if(isset($this->aRegistryPlugins[$sType]) && |
|
| 226 | + if (isset($this->aRegistryPlugins[$sType]) && |
|
| 227 | 227 | ($xPlugin = $this->di->g($this->aRegistryPlugins[$sType]))) |
| 228 | 228 | { |
| 229 | 229 | $xPlugin->register($sType, $sCallable, $xPlugin->checkOptions($sCallable, $xOptions)); |
@@ -85,28 +85,28 @@ discard block |
||
| 85 | 85 | private function updateContainer(Config $xConfig) |
| 86 | 86 | { |
| 87 | 87 | $aOptions = $xConfig->getOption('container.set', []); |
| 88 | - foreach($aOptions as $xKey => $xValue) |
|
| 88 | + foreach ($aOptions as $xKey => $xValue) |
|
| 89 | 89 | { |
| 90 | 90 | // The key is the class name. It must be a string. |
| 91 | - $this->di->set((string)$xKey, $xValue); |
|
| 91 | + $this->di->set((string) $xKey, $xValue); |
|
| 92 | 92 | } |
| 93 | 93 | $aOptions = $xConfig->getOption('container.val', []); |
| 94 | - foreach($aOptions as $xKey => $xValue) |
|
| 94 | + foreach ($aOptions as $xKey => $xValue) |
|
| 95 | 95 | { |
| 96 | 96 | // The key is the class name. It must be a string. |
| 97 | - $this->di->val((string)$xKey, $xValue); |
|
| 97 | + $this->di->val((string) $xKey, $xValue); |
|
| 98 | 98 | } |
| 99 | 99 | $aOptions = $xConfig->getOption('container.auto', []); |
| 100 | - foreach($aOptions as $xValue) |
|
| 100 | + foreach ($aOptions as $xValue) |
|
| 101 | 101 | { |
| 102 | 102 | // The key is the class name. It must be a string. |
| 103 | - $this->di->auto((string)$xValue); |
|
| 103 | + $this->di->auto((string) $xValue); |
|
| 104 | 104 | } |
| 105 | 105 | $aOptions = $xConfig->getOption('container.alias', []); |
| 106 | - foreach($aOptions as $xKey => $xValue) |
|
| 106 | + foreach ($aOptions as $xKey => $xValue) |
|
| 107 | 107 | { |
| 108 | 108 | // The key is the class name. It must be a string. |
| 109 | - $this->di->alias((string)$xKey, (string)$xValue); |
|
| 109 | + $this->di->alias((string) $xKey, (string) $xValue); |
|
| 110 | 110 | } |
| 111 | 111 | } |
| 112 | 112 | |
@@ -121,14 +121,14 @@ discard block |
||
| 121 | 121 | */ |
| 122 | 122 | private function registerCallables(array $aOptions, string $sCallableType) |
| 123 | 123 | { |
| 124 | - foreach($aOptions as $xKey => $xValue) |
|
| 124 | + foreach ($aOptions as $xKey => $xValue) |
|
| 125 | 125 | { |
| 126 | - if(is_integer($xKey) && is_string($xValue)) |
|
| 126 | + if (is_integer($xKey) && is_string($xValue)) |
|
| 127 | 127 | { |
| 128 | 128 | // Register a function without options |
| 129 | 129 | $this->xPluginManager->registerCallable($sCallableType, $xValue); |
| 130 | 130 | } |
| 131 | - elseif(is_string($xKey) && (is_array($xValue) || is_string($xValue))) |
|
| 131 | + elseif (is_string($xKey) && (is_array($xValue) || is_string($xValue))) |
|
| 132 | 132 | { |
| 133 | 133 | // Register a function with options |
| 134 | 134 | $this->xPluginManager->registerCallable($sCallableType, $xKey, $xValue); |
@@ -171,12 +171,12 @@ discard block |
||
| 171 | 171 | { |
| 172 | 172 | // $this->aPackages contains packages config file paths. |
| 173 | 173 | $aLibOptions = $sClassName::config(); |
| 174 | - if(is_string($aLibOptions)) |
|
| 174 | + if (is_string($aLibOptions)) |
|
| 175 | 175 | { |
| 176 | 176 | // A string is supposed to be the path to a config file. |
| 177 | 177 | $aLibOptions = $this->xConfigManager->read($aLibOptions); |
| 178 | 178 | } |
| 179 | - elseif(!is_array($aLibOptions)) |
|
| 179 | + elseif (!is_array($aLibOptions)) |
|
| 180 | 180 | { |
| 181 | 181 | // Otherwise, anything else than an array is not accepted. |
| 182 | 182 | $sMessage = $this->xTranslator->trans('errors.register.invalid', ['name' => $sClassName]); |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | public function registerPackage(string $sClassName, array $aUserOptions) |
| 198 | 198 | { |
| 199 | 199 | $sClassName = trim($sClassName, '\\ '); |
| 200 | - if(!is_subclass_of($sClassName, Package::class)) |
|
| 200 | + if (!is_subclass_of($sClassName, Package::class)) |
|
| 201 | 201 | { |
| 202 | 202 | $sMessage = $this->xTranslator->trans('errors.register.invalid', ['name' => $sClassName]); |
| 203 | 203 | throw new SetupException($sMessage); |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | |
| 242 | 242 | // Register packages |
| 243 | 243 | $aPackageConfig = $xAppConfig->getOption('packages', []); |
| 244 | - foreach($aPackageConfig as $sClassName => $aPkgOptions) |
|
| 244 | + foreach ($aPackageConfig as $sClassName => $aPkgOptions) |
|
| 245 | 245 | { |
| 246 | 246 | $this->registerPackage($sClassName, $aPkgOptions); |
| 247 | 247 | } |
@@ -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]); |
@@ -62,12 +62,12 @@ |
||
| 62 | 62 | public function request(string $sClassName = ''): ?RequestFactory |
| 63 | 63 | { |
| 64 | 64 | $sClassName = trim($sClassName); |
| 65 | - if(!$sClassName) |
|
| 65 | + if (!$sClassName) |
|
| 66 | 66 | { |
| 67 | 67 | // There is a single request factory for all callable functions. |
| 68 | 68 | return $this->xRequestFactory->noPrefix(false); |
| 69 | 69 | } |
| 70 | - if($sClassName === '.') |
|
| 70 | + if ($sClassName === '.') |
|
| 71 | 71 | { |
| 72 | 72 | // The request factory is for a js function, not a Jaxon call. |
| 73 | 73 | return $this->xRequestFactory->noPrefix(true); |
@@ -56,7 +56,7 @@ |
||
| 56 | 56 | */ |
| 57 | 57 | public function onChange(Config $xConfig, string $sName) |
| 58 | 58 | { |
| 59 | - foreach($this->aListeners as $sListener) |
|
| 59 | + foreach ($this->aListeners as $sListener) |
|
| 60 | 60 | { |
| 61 | 61 | $this->di->g($sListener)->onChange($xConfig, $sName); |
| 62 | 62 | } |
@@ -75,22 +75,22 @@ discard block |
||
| 75 | 75 | { |
| 76 | 76 | return $this->xConfigReader->read($sConfigFile); |
| 77 | 77 | } |
| 78 | - catch(YamlExtension $e) |
|
| 78 | + catch (YamlExtension $e) |
|
| 79 | 79 | { |
| 80 | 80 | $sMessage = $this->xTranslator->trans('errors.yaml.install'); |
| 81 | 81 | throw new SetupException($sMessage); |
| 82 | 82 | } |
| 83 | - catch(FileExtension $e) |
|
| 83 | + catch (FileExtension $e) |
|
| 84 | 84 | { |
| 85 | 85 | $sMessage = $this->xTranslator->trans('errors.file.extension', ['path' => $sConfigFile]); |
| 86 | 86 | throw new SetupException($sMessage); |
| 87 | 87 | } |
| 88 | - catch(FileAccess $e) |
|
| 88 | + catch (FileAccess $e) |
|
| 89 | 89 | { |
| 90 | 90 | $sMessage = $this->xTranslator->trans('errors.file.access', ['path' => $sConfigFile]); |
| 91 | 91 | throw new SetupException($sMessage); |
| 92 | 92 | } |
| 93 | - catch(FileContent $e) |
|
| 93 | + catch (FileContent $e) |
|
| 94 | 94 | { |
| 95 | 95 | $sMessage = $this->xTranslator->trans('errors.file.content', ['path' => $sConfigFile]); |
| 96 | 96 | throw new SetupException($sMessage); |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | // Call the config change listeners. |
| 116 | 116 | $this->xEventManager->onChange($this->xConfig, ''); |
| 117 | 117 | } |
| 118 | - catch(DataDepth $e) |
|
| 118 | + catch (DataDepth $e) |
|
| 119 | 119 | { |
| 120 | 120 | $sMessage = $this->xTranslator->trans('errors.data.depth', |
| 121 | 121 | ['key' => $e->sPrefix, 'depth' => $e->nDepth]); |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | { |
| 137 | 137 | try |
| 138 | 138 | { |
| 139 | - if(!$this->xConfig->setOptions($aOptions, $sKeys)) |
|
| 139 | + if (!$this->xConfig->setOptions($aOptions, $sKeys)) |
|
| 140 | 140 | { |
| 141 | 141 | return false; |
| 142 | 142 | } |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | $this->xEventManager->onChange($this->xConfig, ''); |
| 145 | 145 | return true; |
| 146 | 146 | } |
| 147 | - catch(DataDepth $e) |
|
| 147 | + catch (DataDepth $e) |
|
| 148 | 148 | { |
| 149 | 149 | $sMessage = $this->xTranslator->trans('errors.data.depth', |
| 150 | 150 | ['key' => $e->sPrefix, 'depth' => $e->nDepth]); |
@@ -219,7 +219,7 @@ discard block |
||
| 219 | 219 | { |
| 220 | 220 | return new Config($aOptions, $sKeys); |
| 221 | 221 | } |
| 222 | - catch(DataDepth $e) |
|
| 222 | + catch (DataDepth $e) |
|
| 223 | 223 | { |
| 224 | 224 | $sMessage = $this->xTranslator->trans('errors.data.depth', |
| 225 | 225 | ['key' => $e->sPrefix, 'depth' => $e->nDepth]); |
@@ -74,23 +74,19 @@ discard block |
||
| 74 | 74 | try |
| 75 | 75 | { |
| 76 | 76 | return $this->xConfigReader->read($sConfigFile); |
| 77 | - } |
|
| 78 | - catch(YamlExtension $e) |
|
| 77 | + } catch(YamlExtension $e) |
|
| 79 | 78 | { |
| 80 | 79 | $sMessage = $this->xTranslator->trans('errors.yaml.install'); |
| 81 | 80 | throw new SetupException($sMessage); |
| 82 | - } |
|
| 83 | - catch(FileExtension $e) |
|
| 81 | + } catch(FileExtension $e) |
|
| 84 | 82 | { |
| 85 | 83 | $sMessage = $this->xTranslator->trans('errors.file.extension', ['path' => $sConfigFile]); |
| 86 | 84 | throw new SetupException($sMessage); |
| 87 | - } |
|
| 88 | - catch(FileAccess $e) |
|
| 85 | + } catch(FileAccess $e) |
|
| 89 | 86 | { |
| 90 | 87 | $sMessage = $this->xTranslator->trans('errors.file.access', ['path' => $sConfigFile]); |
| 91 | 88 | throw new SetupException($sMessage); |
| 92 | - } |
|
| 93 | - catch(FileContent $e) |
|
| 89 | + } catch(FileContent $e) |
|
| 94 | 90 | { |
| 95 | 91 | $sMessage = $this->xTranslator->trans('errors.file.content', ['path' => $sConfigFile]); |
| 96 | 92 | throw new SetupException($sMessage); |
@@ -114,8 +110,7 @@ discard block |
||
| 114 | 110 | $this->xConfig->setOptions($this->read($sConfigFile), $sConfigSection); |
| 115 | 111 | // Call the config change listeners. |
| 116 | 112 | $this->xEventManager->onChange($this->xConfig, ''); |
| 117 | - } |
|
| 118 | - catch(DataDepth $e) |
|
| 113 | + } catch(DataDepth $e) |
|
| 119 | 114 | { |
| 120 | 115 | $sMessage = $this->xTranslator->trans('errors.data.depth', |
| 121 | 116 | ['key' => $e->sPrefix, 'depth' => $e->nDepth]); |
@@ -143,8 +138,7 @@ discard block |
||
| 143 | 138 | // Call the config change listeners. |
| 144 | 139 | $this->xEventManager->onChange($this->xConfig, ''); |
| 145 | 140 | return true; |
| 146 | - } |
|
| 147 | - catch(DataDepth $e) |
|
| 141 | + } catch(DataDepth $e) |
|
| 148 | 142 | { |
| 149 | 143 | $sMessage = $this->xTranslator->trans('errors.data.depth', |
| 150 | 144 | ['key' => $e->sPrefix, 'depth' => $e->nDepth]); |
@@ -218,8 +212,7 @@ discard block |
||
| 218 | 212 | try |
| 219 | 213 | { |
| 220 | 214 | return new Config($aOptions, $sKeys); |
| 221 | - } |
|
| 222 | - catch(DataDepth $e) |
|
| 215 | + } catch(DataDepth $e) |
|
| 223 | 216 | { |
| 224 | 217 | $sMessage = $this->xTranslator->trans('errors.data.depth', |
| 225 | 218 | ['key' => $e->sPrefix, 'depth' => $e->nDepth]); |
@@ -26,7 +26,7 @@ |
||
| 26 | 26 | public function onChange(Config $xConfig, string $sName) |
| 27 | 27 | { |
| 28 | 28 | // Set the library language any time the config is changed. |
| 29 | - if($sName === '' || $sName === 'core.language') |
|
| 29 | + if ($sName === '' || $sName === 'core.language') |
|
| 30 | 30 | { |
| 31 | 31 | $this->setLocale($xConfig->getOption('core.language')); |
| 32 | 32 | } |
@@ -133,15 +133,15 @@ discard block |
||
| 133 | 133 | */ |
| 134 | 134 | public function checkOptions(string $sCallable, $xOptions): array |
| 135 | 135 | { |
| 136 | - if(!$this->xValidator->validateClass(trim($sCallable))) |
|
| 136 | + if (!$this->xValidator->validateClass(trim($sCallable))) |
|
| 137 | 137 | { |
| 138 | 138 | throw new SetupException($this->xTranslator->trans('errors.objects.invalid-declaration')); |
| 139 | 139 | } |
| 140 | - if(is_string($xOptions)) |
|
| 140 | + if (is_string($xOptions)) |
|
| 141 | 141 | { |
| 142 | 142 | $xOptions = ['include' => $xOptions]; |
| 143 | 143 | } |
| 144 | - elseif(!is_array($xOptions)) |
|
| 144 | + elseif (!is_array($xOptions)) |
|
| 145 | 145 | { |
| 146 | 146 | throw new SetupException($this->xTranslator->trans('errors.objects.invalid-declaration')); |
| 147 | 147 | } |
@@ -186,16 +186,16 @@ discard block |
||
| 186 | 186 | $sCode = ''; |
| 187 | 187 | $aJsClasses = []; |
| 188 | 188 | $aNamespaces = $this->xRepository->getNamespaces(); |
| 189 | - foreach($aNamespaces as $sNamespace) |
|
| 189 | + foreach ($aNamespaces as $sNamespace) |
|
| 190 | 190 | { |
| 191 | 191 | $offset = 0; |
| 192 | 192 | $sJsNamespace = str_replace('\\', '.', $sNamespace); |
| 193 | 193 | $sJsNamespace .= '.Null'; // This is a sentinel. The last token is not processed in the while loop. |
| 194 | - while(($dotPosition = strpos($sJsNamespace, '.', $offset)) !== false) |
|
| 194 | + while (($dotPosition = strpos($sJsNamespace, '.', $offset)) !== false) |
|
| 195 | 195 | { |
| 196 | 196 | $sJsClass = substr($sJsNamespace, 0, $dotPosition); |
| 197 | 197 | // Generate code for this object |
| 198 | - if(!isset($aJsClasses[$sJsClass])) |
|
| 198 | + if (!isset($aJsClasses[$sJsClass])) |
|
| 199 | 199 | { |
| 200 | 200 | $sCode .= $this->sPrefix . "$sJsClass = {};\n"; |
| 201 | 201 | $aJsClasses[$sJsClass] = $sJsClass; |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | */ |
| 217 | 217 | private function getCallableScript(string $sClassName, CallableObject $xCallableObject): string |
| 218 | 218 | { |
| 219 | - if($xCallableObject->excluded()) |
|
| 219 | + if ($xCallableObject->excluded()) |
|
| 220 | 220 | { |
| 221 | 221 | return ''; |
| 222 | 222 | } |
@@ -244,7 +244,7 @@ discard block |
||
| 244 | 244 | }); |
| 245 | 245 | |
| 246 | 246 | $sCode = $this->getNamespacesScript(); |
| 247 | - foreach($aCallableObjects as $sClassName => $xCallableObject) |
|
| 247 | + foreach ($aCallableObjects as $sClassName => $xCallableObject) |
|
| 248 | 248 | { |
| 249 | 249 | $sCode .= $this->getCallableScript($sClassName, $xCallableObject); |
| 250 | 250 | } |
@@ -257,7 +257,7 @@ discard block |
||
| 257 | 257 | public static function canProcessRequest(ServerRequestInterface $xRequest): bool |
| 258 | 258 | { |
| 259 | 259 | $aBody = $xRequest->getParsedBody(); |
| 260 | - if(is_array($aBody)) |
|
| 260 | + if (is_array($aBody)) |
|
| 261 | 261 | { |
| 262 | 262 | return isset($aBody['jxncls']) && isset($aBody['jxnmthd']); |
| 263 | 263 | } |
@@ -271,7 +271,7 @@ discard block |
||
| 271 | 271 | public function setTarget(ServerRequestInterface $xRequest) |
| 272 | 272 | { |
| 273 | 273 | $aBody = $xRequest->getParsedBody(); |
| 274 | - if(is_array($aBody)) |
|
| 274 | + if (is_array($aBody)) |
|
| 275 | 275 | { |
| 276 | 276 | $this->xTarget = Target::makeClass(trim($aBody['jxncls']), trim($aBody['jxnmthd'])); |
| 277 | 277 | return; |
@@ -290,7 +290,7 @@ discard block |
||
| 290 | 290 | $sMethodName = $this->xTarget->getMethodName(); |
| 291 | 291 | $this->xTarget->setMethodArgs($this->xParameterReader->args()); |
| 292 | 292 | |
| 293 | - if(!$this->xValidator->validateClass($sClassName) || !$this->xValidator->validateMethod($sMethodName)) |
|
| 293 | + if (!$this->xValidator->validateClass($sClassName) || !$this->xValidator->validateMethod($sMethodName)) |
|
| 294 | 294 | { |
| 295 | 295 | // Unable to find the requested object or method |
| 296 | 296 | throw new RequestException($this->xTranslator->trans('errors.objects.invalid', |
@@ -303,7 +303,7 @@ discard block |
||
| 303 | 303 | $xCallableObject = $this->xRegistry->getCallableObject($sClassName); |
| 304 | 304 | return $xCallableObject->call($this->xTarget); |
| 305 | 305 | } |
| 306 | - catch(ReflectionException|SetupException $e) |
|
| 306 | + catch (ReflectionException | SetupException $e) |
|
| 307 | 307 | { |
| 308 | 308 | // Unable to find the requested class or method |
| 309 | 309 | $this->di->getLogger()->error($e->getMessage()); |
@@ -140,8 +140,7 @@ discard block |
||
| 140 | 140 | if(is_string($xOptions)) |
| 141 | 141 | { |
| 142 | 142 | $xOptions = ['include' => $xOptions]; |
| 143 | - } |
|
| 144 | - elseif(!is_array($xOptions)) |
|
| 143 | + } elseif(!is_array($xOptions)) |
|
| 145 | 144 | { |
| 146 | 145 | throw new SetupException($this->xTranslator->trans('errors.objects.invalid-declaration')); |
| 147 | 146 | } |
@@ -302,8 +301,7 @@ discard block |
||
| 302 | 301 | { |
| 303 | 302 | $xCallableObject = $this->xRegistry->getCallableObject($sClassName); |
| 304 | 303 | return $xCallableObject->call($this->xTarget); |
| 305 | - } |
|
| 306 | - catch(ReflectionException|SetupException $e) |
|
| 304 | + } catch(ReflectionException|SetupException $e) |
|
| 307 | 305 | { |
| 308 | 306 | // Unable to find the requested class or method |
| 309 | 307 | $this->di->getLogger()->error($e->getMessage()); |