@@ -89,15 +89,15 @@ |
||
| 89 | 89 | return $this->xManager->getErrorMessage(); |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | - /** |
|
| 93 | - * Add a response command to the array of commands |
|
| 94 | - * |
|
| 95 | - * @param string $sName The command name |
|
| 96 | - * @param array|JsonSerializable $aArgs The command arguments |
|
| 97 | - * @param bool $bRemoveEmpty |
|
| 98 | - * |
|
| 99 | - * @return Command |
|
| 100 | - */ |
|
| 92 | + /** |
|
| 93 | + * Add a response command to the array of commands |
|
| 94 | + * |
|
| 95 | + * @param string $sName The command name |
|
| 96 | + * @param array|JsonSerializable $aArgs The command arguments |
|
| 97 | + * @param bool $bRemoveEmpty |
|
| 98 | + * |
|
| 99 | + * @return Command |
|
| 100 | + */ |
|
| 101 | 101 | public function addCommand(string $sName, array|JsonSerializable $aArgs = [], |
| 102 | 102 | bool $bRemoveEmpty = false): Command |
| 103 | 103 | { |
@@ -98,7 +98,7 @@ |
||
| 98 | 98 | * |
| 99 | 99 | * @return Command |
| 100 | 100 | */ |
| 101 | - public function addCommand(string $sName, array|JsonSerializable $aArgs = [], |
|
| 101 | + public function addCommand(string $sName, array | JsonSerializable $aArgs = [], |
|
| 102 | 102 | bool $bRemoveEmpty = false): Command |
| 103 | 103 | { |
| 104 | 104 | return $this->xManager->addCommand($sName, $aArgs, $bRemoveEmpty); |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | */ |
| 54 | 54 | private function str($xData): string |
| 55 | 55 | { |
| 56 | - return trim((string)$xData, " \t\n"); |
|
| 56 | + return trim((string) $xData, " \t\n"); |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | /** |
@@ -64,9 +64,9 @@ discard block |
||
| 64 | 64 | * |
| 65 | 65 | * @return Command |
| 66 | 66 | */ |
| 67 | - public function setOption(string $sName, string|array|JsonSerializable $xValue): Command |
|
| 67 | + public function setOption(string $sName, string | array | JsonSerializable $xValue): Command |
|
| 68 | 68 | { |
| 69 | - if(isset($this->aCommand['options'])) |
|
| 69 | + if (isset($this->aCommand['options'])) |
|
| 70 | 70 | { |
| 71 | 71 | $this->aCommand['options'][$this->str($sName)] = $xValue; |
| 72 | 72 | return $this; |
@@ -68,7 +68,7 @@ |
||
| 68 | 68 | * |
| 69 | 69 | * @return Command |
| 70 | 70 | */ |
| 71 | - public function addCommand(string $sName, array|JsonSerializable $aArgs = [], |
|
| 71 | + public function addCommand(string $sName, array | JsonSerializable $aArgs = [], |
|
| 72 | 72 | bool $bRemoveEmpty = false): Command |
| 73 | 73 | { |
| 74 | 74 | return $this->xManager |
@@ -80,7 +80,7 @@ |
||
| 80 | 80 | * |
| 81 | 81 | * @return Command |
| 82 | 82 | */ |
| 83 | - public function addCommand(string $sName, array|JsonSerializable $aOptions): Command |
|
| 83 | + public function addCommand(string $sName, array | JsonSerializable $aOptions): Command |
|
| 84 | 84 | { |
| 85 | 85 | return $this->xResponse |
| 86 | 86 | ->addCommand($sName, $aOptions) |
@@ -136,18 +136,18 @@ discard block |
||
| 136 | 136 | $aOptions = $this->getOptionNames($sKeyPrefix); |
| 137 | 137 | $sSpaces = str_repeat(' ', $nSpaces); |
| 138 | 138 | $sScript = ''; |
| 139 | - foreach($aOptions as $sShortName => $sFullName) |
|
| 139 | + foreach ($aOptions as $sShortName => $sFullName) |
|
| 140 | 140 | { |
| 141 | 141 | $value = $this->xConfigManager->getOption($sFullName); |
| 142 | - if(is_string($value)) |
|
| 142 | + if (is_string($value)) |
|
| 143 | 143 | { |
| 144 | 144 | $value = "'$value'"; |
| 145 | 145 | } |
| 146 | - elseif(is_bool($value)) |
|
| 146 | + elseif (is_bool($value)) |
|
| 147 | 147 | { |
| 148 | 148 | $value = ($value ? 'true' : 'false'); |
| 149 | 149 | } |
| 150 | - elseif(!is_numeric($value)) |
|
| 150 | + elseif (!is_numeric($value)) |
|
| 151 | 151 | { |
| 152 | 152 | $value = json_encode($value); |
| 153 | 153 | } |
@@ -175,10 +175,10 @@ discard block |
||
| 175 | 175 | */ |
| 176 | 176 | public function getJsCode(string $sFile): string |
| 177 | 177 | { |
| 178 | - if($this->hasOption('assets.js')) |
|
| 178 | + if ($this->hasOption('assets.js')) |
|
| 179 | 179 | { |
| 180 | 180 | // If this expression evaluates to false, then the asset is not displayed. |
| 181 | - if(!($sUri = $this->getOption('assets.js'))) |
|
| 181 | + if (!($sUri = $this->getOption('assets.js'))) |
|
| 182 | 182 | { |
| 183 | 183 | return ''; |
| 184 | 184 | } |
@@ -200,10 +200,10 @@ discard block |
||
| 200 | 200 | */ |
| 201 | 201 | public function getCssCode(string $sFile): string |
| 202 | 202 | { |
| 203 | - if($this->hasOption('assets.css')) |
|
| 203 | + if ($this->hasOption('assets.css')) |
|
| 204 | 204 | { |
| 205 | 205 | // If this expression evaluates to false, then the asset is not displayed. |
| 206 | - if(!($sUri = $this->getOption('assets.css'))) |
|
| 206 | + if (!($sUri = $this->getOption('assets.css'))) |
|
| 207 | 207 | { |
| 208 | 208 | return ''; |
| 209 | 209 | } |
@@ -142,12 +142,10 @@ discard block |
||
| 142 | 142 | if(is_string($value)) |
| 143 | 143 | { |
| 144 | 144 | $value = "'$value'"; |
| 145 | - } |
|
| 146 | - elseif(is_bool($value)) |
|
| 145 | + } elseif(is_bool($value)) |
|
| 147 | 146 | { |
| 148 | 147 | $value = ($value ? 'true' : 'false'); |
| 149 | - } |
|
| 150 | - elseif(!is_numeric($value)) |
|
| 148 | + } elseif(!is_numeric($value)) |
|
| 151 | 149 | { |
| 152 | 150 | $value = json_encode($value); |
| 153 | 151 | } |
@@ -182,8 +180,7 @@ discard block |
||
| 182 | 180 | { |
| 183 | 181 | return ''; |
| 184 | 182 | } |
| 185 | - } |
|
| 186 | - else |
|
| 183 | + } else |
|
| 187 | 184 | { |
| 188 | 185 | $sUri = $this->sUri . '/' . ($this->sSubDir ? $this->sSubDir . '/' : '') . |
| 189 | 186 | ($this->sVersion ? $this->sVersion . '/' : '') . $sFile; |
@@ -207,8 +204,7 @@ discard block |
||
| 207 | 204 | { |
| 208 | 205 | return ''; |
| 209 | 206 | } |
| 210 | - } |
|
| 211 | - else |
|
| 207 | + } else |
|
| 212 | 208 | { |
| 213 | 209 | $sUri = $this->sUri . '/' . ($this->sSubDir ? $this->sSubDir . '/' : '') . |
| 214 | 210 | ($this->sVersion ? $this->sVersion . '/' : '') . $sFile; |
@@ -115,7 +115,7 @@ |
||
| 115 | 115 | */ |
| 116 | 116 | private function getLibraries(): array |
| 117 | 117 | { |
| 118 | - if($this->aLibraries === null) |
|
| 118 | + if ($this->aLibraries === null) |
|
| 119 | 119 | { |
| 120 | 120 | $this->aLibraries = $this->xDialogManager->getLibraries(); |
| 121 | 121 | } |
@@ -331,16 +331,16 @@ |
||
| 331 | 331 | $sPrefix = substr($sName, 0, 15); |
| 332 | 332 | switch($sPrefix) |
| 333 | 333 | { |
| 334 | - case 'dialogs.default': |
|
| 335 | - $this->setDefaultLibraries(); |
|
| 336 | - return; |
|
| 337 | - case 'dialogs.lib.ext': |
|
| 338 | - $this->registerLibraries(); |
|
| 339 | - return; |
|
| 340 | - case 'dialogs.lib.use': |
|
| 341 | - $this->setUsedLibraries(); |
|
| 342 | - return; |
|
| 343 | - default: |
|
| 334 | + case 'dialogs.default': |
|
| 335 | + $this->setDefaultLibraries(); |
|
| 336 | + return; |
|
| 337 | + case 'dialogs.lib.ext': |
|
| 338 | + $this->registerLibraries(); |
|
| 339 | + return; |
|
| 340 | + case 'dialogs.lib.use': |
|
| 341 | + $this->setUsedLibraries(); |
|
| 342 | + return; |
|
| 343 | + default: |
|
| 344 | 344 | } |
| 345 | 345 | } |
| 346 | 346 | } |
@@ -106,11 +106,11 @@ discard block |
||
| 106 | 106 | */ |
| 107 | 107 | public function registerLibrary(string $sClassName, string $sLibraryName) |
| 108 | 108 | { |
| 109 | - if(isset($this->aLibraries[$sLibraryName])) |
|
| 109 | + if (isset($this->aLibraries[$sLibraryName])) |
|
| 110 | 110 | { |
| 111 | 111 | return; |
| 112 | 112 | } |
| 113 | - if(!($aInterfaces = class_implements($sClassName))) |
|
| 113 | + if (!($aInterfaces = class_implements($sClassName))) |
|
| 114 | 114 | { |
| 115 | 115 | // The class is invalid. |
| 116 | 116 | $sMessage = $this->xTranslator->trans('errors.register.invalid', ['name' => $sClassName]); |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | $bIsQuestion = in_array(QuestionInterface::class, $aInterfaces); |
| 121 | 121 | $bIsMessage = in_array(MessageInterface::class, $aInterfaces); |
| 122 | 122 | $bIsModal = in_array(ModalInterface::class, $aInterfaces); |
| 123 | - if(!$bIsQuestion && !$bIsMessage && !$bIsModal) |
|
| 123 | + if (!$bIsQuestion && !$bIsMessage && !$bIsModal) |
|
| 124 | 124 | { |
| 125 | 125 | // The class is invalid. |
| 126 | 126 | $sMessage = $this->xTranslator->trans('errors.register.invalid', ['name' => $sClassName]); |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | */ |
| 149 | 149 | public function setQuestionLibrary(string $sLibraryName) |
| 150 | 150 | { |
| 151 | - if(!isset($this->aLibraries[$sLibraryName]) || !$this->aLibraries[$sLibraryName]['question']) |
|
| 151 | + if (!isset($this->aLibraries[$sLibraryName]) || !$this->aLibraries[$sLibraryName]['question']) |
|
| 152 | 152 | { |
| 153 | 153 | $sMessage = $this->xTranslator->trans('errors.dialog.library', |
| 154 | 154 | ['type' => 'question', 'name' => $sLibraryName]); |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | */ |
| 178 | 178 | public function setMessageLibrary(string $sLibraryName) |
| 179 | 179 | { |
| 180 | - if(!isset($this->aLibraries[$sLibraryName]) || !$this->aLibraries[$sLibraryName]['message']) |
|
| 180 | + if (!isset($this->aLibraries[$sLibraryName]) || !$this->aLibraries[$sLibraryName]['message']) |
|
| 181 | 181 | { |
| 182 | 182 | $sMessage = $this->xTranslator->trans('errors.dialog.library', |
| 183 | 183 | ['type' => 'message', 'name' => $sLibraryName]); |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | */ |
| 207 | 207 | public function setModalLibrary(string $sLibraryName) |
| 208 | 208 | { |
| 209 | - if(!isset($this->aLibraries[$sLibraryName]) || !$this->aLibraries[$sLibraryName]['modal']) |
|
| 209 | + if (!isset($this->aLibraries[$sLibraryName]) || !$this->aLibraries[$sLibraryName]['modal']) |
|
| 210 | 210 | { |
| 211 | 211 | $sMessage = $this->xTranslator->trans('errors.dialog.library', |
| 212 | 212 | ['type' => 'modal', 'name' => $sLibraryName]); |
@@ -246,7 +246,7 @@ discard block |
||
| 246 | 246 | protected function registerLibraries() |
| 247 | 247 | { |
| 248 | 248 | $aLibraries = $this->xConfigManager->getOption('dialogs.lib.ext', []); |
| 249 | - foreach($aLibraries as $sLibraryName => $sClassName) |
|
| 249 | + foreach ($aLibraries as $sLibraryName => $sClassName) |
|
| 250 | 250 | { |
| 251 | 251 | $this->registerLibrary($sClassName, $sLibraryName); |
| 252 | 252 | } |
@@ -261,19 +261,19 @@ discard block |
||
| 261 | 261 | protected function setDefaultLibraries() |
| 262 | 262 | { |
| 263 | 263 | // Set the default modal library |
| 264 | - if(($sLibraryName = $this->xConfigManager->getOption('dialogs.default.modal', ''))) |
|
| 264 | + if (($sLibraryName = $this->xConfigManager->getOption('dialogs.default.modal', ''))) |
|
| 265 | 265 | { |
| 266 | 266 | $this->setModalLibrary($sLibraryName); |
| 267 | 267 | $this->aLibraries[$sLibraryName]['used'] = true; |
| 268 | 268 | } |
| 269 | 269 | // Set the default message library |
| 270 | - if(($sLibraryName = $this->xConfigManager->getOption('dialogs.default.message', ''))) |
|
| 270 | + if (($sLibraryName = $this->xConfigManager->getOption('dialogs.default.message', ''))) |
|
| 271 | 271 | { |
| 272 | 272 | $this->setMessageLibrary($sLibraryName); |
| 273 | 273 | $this->aLibraries[$sLibraryName]['used'] = true; |
| 274 | 274 | } |
| 275 | 275 | // Set the default question library |
| 276 | - if(($sLibraryName = $this->xConfigManager->getOption('dialogs.default.question', ''))) |
|
| 276 | + if (($sLibraryName = $this->xConfigManager->getOption('dialogs.default.question', ''))) |
|
| 277 | 277 | { |
| 278 | 278 | $this->setQuestionLibrary($sLibraryName); |
| 279 | 279 | $this->aLibraries[$sLibraryName]['used'] = true; |
@@ -289,9 +289,9 @@ discard block |
||
| 289 | 289 | { |
| 290 | 290 | // Set the other libraries in use |
| 291 | 291 | $aLibraries = $this->xConfigManager->getOption('dialogs.lib.use', []); |
| 292 | - foreach($aLibraries as $sLibraryName) |
|
| 292 | + foreach ($aLibraries as $sLibraryName) |
|
| 293 | 293 | { |
| 294 | - if(isset($this->aLibraries[$sLibraryName])) // Make sure the library exists |
|
| 294 | + if (isset($this->aLibraries[$sLibraryName])) // Make sure the library exists |
|
| 295 | 295 | { |
| 296 | 296 | $this->aLibraries[$sLibraryName]['used'] = true; |
| 297 | 297 | } |
@@ -320,7 +320,7 @@ discard block |
||
| 320 | 320 | */ |
| 321 | 321 | public function onChange(Config $xConfig, string $sName) |
| 322 | 322 | { |
| 323 | - if($sName === '') |
|
| 323 | + if ($sName === '') |
|
| 324 | 324 | { |
| 325 | 325 | // Reset the default libraries any time the config is changed. |
| 326 | 326 | $this->registerLibraries(); |
@@ -329,7 +329,7 @@ discard block |
||
| 329 | 329 | return; |
| 330 | 330 | } |
| 331 | 331 | $sPrefix = substr($sName, 0, 15); |
| 332 | - switch($sPrefix) |
|
| 332 | + switch ($sPrefix) |
|
| 333 | 333 | { |
| 334 | 334 | case 'dialogs.default': |
| 335 | 335 | $this->setDefaultLibraries(); |
@@ -291,10 +291,12 @@ |
||
| 291 | 291 | $aLibraries = $this->xConfigManager->getOption('dialogs.lib.use', []); |
| 292 | 292 | foreach($aLibraries as $sLibraryName) |
| 293 | 293 | { |
| 294 | - if(isset($this->aLibraries[$sLibraryName])) // Make sure the library exists |
|
| 294 | + if(isset($this->aLibraries[$sLibraryName])) { |
|
| 295 | + // Make sure the library exists |
|
| 295 | 296 | { |
| 296 | 297 | $this->aLibraries[$sLibraryName]['used'] = true; |
| 297 | 298 | } |
| 299 | + } |
|
| 298 | 300 | } |
| 299 | 301 | } |
| 300 | 302 | |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | */ |
| 98 | 98 | public function addCodeGenerator(string $sClassName, int $nPriority) |
| 99 | 99 | { |
| 100 | - while(isset($this->aCodeGenerators[$nPriority])) |
|
| 100 | + while (isset($this->aCodeGenerators[$nPriority])) |
|
| 101 | 101 | { |
| 102 | 102 | $nPriority++; |
| 103 | 103 | } |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | private function generatePluginCodes(string $sClassName) |
| 142 | 142 | { |
| 143 | 143 | $xGenerator = $this->di->g($sClassName); |
| 144 | - if(!is_subclass_of($xGenerator, AbstractPlugin::class) || |
|
| 144 | + if (!is_subclass_of($xGenerator, AbstractPlugin::class) || |
|
| 145 | 145 | $this->xAssetManager->shallIncludeAssets($xGenerator)) |
| 146 | 146 | { |
| 147 | 147 | // HTML tags for CSS |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | } |
| 152 | 152 | // Javascript code |
| 153 | 153 | $this->sJsScript = trim($this->sJsScript) . "\n\n" . trim($xGenerator->getScript(), " \n"); |
| 154 | - if($xGenerator->readyEnabled()) |
|
| 154 | + if ($xGenerator->readyEnabled()) |
|
| 155 | 155 | { |
| 156 | 156 | $sScriptAttr = $xGenerator->readyInlined() ? 'sJsInlineScript' : 'sJsReadyScript'; |
| 157 | 157 | $this->$sScriptAttr = trim($this->$sScriptAttr) . "\n\n" . |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | 'sScript' => $this->getJsInit() . trim($this->sJsReadyScript, " \n"), |
| 185 | 185 | ]); |
| 186 | 186 | $this->sJsInlineScript = trim($this->sJsInlineScript, " \n"); |
| 187 | - if(($this->sJsInlineScript)) |
|
| 187 | + if (($this->sJsInlineScript)) |
|
| 188 | 188 | { |
| 189 | 189 | $this->sJsInlineScript = $this->render('ready.js', [ |
| 190 | 190 | 'sScript' => $this->sJsInlineScript . "\n", |
@@ -205,7 +205,7 @@ discard block |
||
| 205 | 205 | */ |
| 206 | 206 | private function generateCodes() |
| 207 | 207 | { |
| 208 | - if($this->bGenerated) |
|
| 208 | + if ($this->bGenerated) |
|
| 209 | 209 | { |
| 210 | 210 | return; |
| 211 | 211 | } |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | |
| 216 | 216 | $this->xAssetManager = $this->di->getAssetManager(); |
| 217 | 217 | $this->sJsOptions = $this->xAssetManager->getJsOptions(); |
| 218 | - foreach($this->aCodeGenerators as $sClassName) |
|
| 218 | + foreach ($this->aCodeGenerators as $sClassName) |
|
| 219 | 219 | { |
| 220 | 220 | $this->generatePluginCodes($sClassName); |
| 221 | 221 | } |
@@ -277,16 +277,16 @@ discard block |
||
| 277 | 277 | { |
| 278 | 278 | $this->generateCodes(); |
| 279 | 279 | $sScript = ''; |
| 280 | - if(($bIncludeCss)) |
|
| 280 | + if (($bIncludeCss)) |
|
| 281 | 281 | { |
| 282 | 282 | $sScript .= $this->getCss() . "\n"; |
| 283 | 283 | } |
| 284 | - if(($bIncludeJs)) |
|
| 284 | + if (($bIncludeJs)) |
|
| 285 | 285 | { |
| 286 | 286 | $sScript .= $this->getJs() . "\n"; |
| 287 | 287 | } |
| 288 | 288 | |
| 289 | - if(!($sUrl = $this->xAssetManager->createJsFiles($this))) |
|
| 289 | + if (!($sUrl = $this->xAssetManager->createJsFiles($this))) |
|
| 290 | 290 | { |
| 291 | 291 | return trim($sScript) . "\n\n" . |
| 292 | 292 | $this->render('wrapper.js', [ |
@@ -80,15 +80,15 @@ discard block |
||
| 80 | 80 | */ |
| 81 | 81 | public function checkOptions(string $sCallable, $xOptions): array |
| 82 | 82 | { |
| 83 | - if(!$this->xValidator->validateClass(trim($sCallable))) |
|
| 83 | + if (!$this->xValidator->validateClass(trim($sCallable))) |
|
| 84 | 84 | { |
| 85 | 85 | throw new SetupException($this->xTranslator->trans('errors.objects.invalid-declaration')); |
| 86 | 86 | } |
| 87 | - if(is_string($xOptions)) |
|
| 87 | + if (is_string($xOptions)) |
|
| 88 | 88 | { |
| 89 | 89 | $xOptions = ['include' => $xOptions]; |
| 90 | 90 | } |
| 91 | - elseif(!is_array($xOptions)) |
|
| 91 | + elseif (!is_array($xOptions)) |
|
| 92 | 92 | { |
| 93 | 93 | throw new SetupException($this->xTranslator->trans('errors.objects.invalid-declaration')); |
| 94 | 94 | } |
@@ -132,16 +132,16 @@ discard block |
||
| 132 | 132 | { |
| 133 | 133 | $sCode = ''; |
| 134 | 134 | $aJsClasses = []; |
| 135 | - foreach($this->xRegistry->getNamespaces() as $sNamespace) |
|
| 135 | + foreach ($this->xRegistry->getNamespaces() as $sNamespace) |
|
| 136 | 136 | { |
| 137 | 137 | $offset = 0; |
| 138 | 138 | $sJsNamespace = str_replace('\\', '.', $sNamespace); |
| 139 | 139 | $sJsNamespace .= '.Null'; // This is a sentinel. The last token is not processed in the while loop. |
| 140 | - while(($dotPosition = strpos($sJsNamespace, '.', $offset)) !== false) |
|
| 140 | + while (($dotPosition = strpos($sJsNamespace, '.', $offset)) !== false) |
|
| 141 | 141 | { |
| 142 | 142 | $sJsClass = substr($sJsNamespace, 0, $dotPosition); |
| 143 | 143 | // Generate code for this object |
| 144 | - if(!isset($aJsClasses[$sJsClass])) |
|
| 144 | + if (!isset($aJsClasses[$sJsClass])) |
|
| 145 | 145 | { |
| 146 | 146 | $sCode .= $this->sPrefix . "$sJsClass = {};\n"; |
| 147 | 147 | $aJsClasses[$sJsClass] = $sJsClass; |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | */ |
| 162 | 162 | private function getCallableScript(CallableObject $xCallableObject): string |
| 163 | 163 | { |
| 164 | - if($xCallableObject->excluded()) |
|
| 164 | + if ($xCallableObject->excluded()) |
|
| 165 | 165 | { |
| 166 | 166 | return ''; |
| 167 | 167 | } |
@@ -223,8 +223,7 @@ discard block |
||
| 223 | 223 | private function throwException(Exception $xException, string $sErrorMessage): void |
| 224 | 224 | { |
| 225 | 225 | $this->di->getLogger()->error($xException->getMessage()); |
| 226 | - throw new RequestException($sErrorMessage . (!$this->bDebug ? '' : |
|
| 227 | - "\n" . $xException->getMessage())); |
|
| 226 | + throw new RequestException($sErrorMessage . (!$this->bDebug ? '' : "\n" . $xException->getMessage())); |
|
| 228 | 227 | } |
| 229 | 228 | |
| 230 | 229 | /** |
@@ -236,7 +235,7 @@ discard block |
||
| 236 | 235 | $sClassName = $this->xTarget->getClassName(); |
| 237 | 236 | $sMethodName = $this->xTarget->getMethodName(); |
| 238 | 237 | |
| 239 | - if(!$this->xValidator->validateClass($sClassName) || |
|
| 238 | + if (!$this->xValidator->validateClass($sClassName) || |
|
| 240 | 239 | !$this->xValidator->validateMethod($sMethodName)) |
| 241 | 240 | { |
| 242 | 241 | // Unable to find the requested object or method |
@@ -250,7 +249,7 @@ discard block |
||
| 250 | 249 | /** @var CallableObject */ |
| 251 | 250 | $xCallableObject = $this->getCallable($sClassName); |
| 252 | 251 | } |
| 253 | - catch(ReflectionException|SetupException $e) |
|
| 252 | + catch (ReflectionException | SetupException $e) |
|
| 254 | 253 | { |
| 255 | 254 | // Unable to find the requested class or method |
| 256 | 255 | $this->throwException($e, $this->xTranslator->trans('errors.objects.invalid', |
@@ -260,7 +259,7 @@ discard block |
||
| 260 | 259 | { |
| 261 | 260 | return $xCallableObject->call($this->xTarget); |
| 262 | 261 | } |
| 263 | - catch(ReflectionException|SetupException $e) |
|
| 262 | + catch (ReflectionException | SetupException $e) |
|
| 264 | 263 | { |
| 265 | 264 | // Unable to execute the requested class or method |
| 266 | 265 | $this->throwException($e, $this->xTranslator->trans('errors.objects.call', |
@@ -87,8 +87,7 @@ discard block |
||
| 87 | 87 | if(is_string($xOptions)) |
| 88 | 88 | { |
| 89 | 89 | $xOptions = ['include' => $xOptions]; |
| 90 | - } |
|
| 91 | - elseif(!is_array($xOptions)) |
|
| 90 | + } elseif(!is_array($xOptions)) |
|
| 92 | 91 | { |
| 93 | 92 | throw new SetupException($this->xTranslator->trans('errors.objects.invalid-declaration')); |
| 94 | 93 | } |
@@ -249,8 +248,7 @@ discard block |
||
| 249 | 248 | { |
| 250 | 249 | /** @var CallableObject */ |
| 251 | 250 | $xCallableObject = $this->getCallable($sClassName); |
| 252 | - } |
|
| 253 | - catch(ReflectionException|SetupException $e) |
|
| 251 | + } catch(ReflectionException|SetupException $e) |
|
| 254 | 252 | { |
| 255 | 253 | // Unable to find the requested class or method |
| 256 | 254 | $this->throwException($e, $this->xTranslator->trans('errors.objects.invalid', |
@@ -259,8 +257,7 @@ discard block |
||
| 259 | 257 | try |
| 260 | 258 | { |
| 261 | 259 | return $xCallableObject->call($this->xTarget); |
| 262 | - } |
|
| 263 | - catch(ReflectionException|SetupException $e) |
|
| 260 | + } catch(ReflectionException|SetupException $e) |
|
| 264 | 261 | { |
| 265 | 262 | // Unable to execute the requested class or method |
| 266 | 263 | $this->throwException($e, $this->xTranslator->trans('errors.objects.call', |