@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | */ |
| 87 | 87 | public function getOutput(): string |
| 88 | 88 | { |
| 89 | - if($this->getCommandCount() === 0) |
|
| 89 | + if ($this->getCommandCount() === 0) |
|
| 90 | 90 | { |
| 91 | 91 | return ''; |
| 92 | 92 | } |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | */ |
| 146 | 146 | public function bag(string $sName): DataBagContext |
| 147 | 147 | { |
| 148 | - return $this->plugin('bags')->bag($sName);; |
|
| 148 | + return $this->plugin('bags')->bag($sName); ; |
|
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | /** |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | public function addCommand(array $aAttributes, $mData): Response |
| 160 | 160 | { |
| 161 | 161 | $aAttributes = array_map(function($xAttribute) { |
| 162 | - return is_integer($xAttribute) ? $xAttribute : trim((string)$xAttribute, " \t"); |
|
| 162 | + return is_integer($xAttribute) ? $xAttribute : trim((string) $xAttribute, " \t"); |
|
| 163 | 163 | }, $aAttributes); |
| 164 | 164 | $aAttributes['data'] = $mData; |
| 165 | 165 | $this->aCommands[] = $aAttributes; |
@@ -179,9 +179,9 @@ discard block |
||
| 179 | 179 | protected function _addCommand(string $sName, array $aAttributes, $mData, bool $bRemoveEmpty = false): Response |
| 180 | 180 | { |
| 181 | 181 | $mData = is_array($mData) ? array_map(function($sData) { |
| 182 | - return trim((string)$sData, " \t\n"); |
|
| 183 | - }, $mData) : trim((string)$mData, " \t\n"); |
|
| 184 | - if($bRemoveEmpty) |
|
| 182 | + return trim((string) $sData, " \t\n"); |
|
| 183 | + }, $mData) : trim((string) $mData, " \t\n"); |
|
| 184 | + if ($bRemoveEmpty) |
|
| 185 | 185 | { |
| 186 | 186 | $aAttributes = array_filter($aAttributes, function($xValue) { |
| 187 | 187 | return $xValue === ''; |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | public function toPsr(): PsrResponseInterface |
| 215 | 215 | { |
| 216 | 216 | $xPsrResponse = $this->xPsr17Factory->createResponse(200); |
| 217 | - if($this->xRequest->getMethod() === 'GET') |
|
| 217 | + if ($this->xRequest->getMethod() === 'GET') |
|
| 218 | 218 | { |
| 219 | 219 | $xPsrResponse = $xPsrResponse |
| 220 | 220 | ->withHeader('Expires', 'Mon, 26 Jul 1997 05:00:00 GMT') |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | */ |
| 80 | 80 | public function clear() |
| 81 | 81 | { |
| 82 | - if($this->xResponse !== null) |
|
| 82 | + if ($this->xResponse !== null) |
|
| 83 | 83 | { |
| 84 | 84 | $this->xResponse->clearCommands(); |
| 85 | 85 | } |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | */ |
| 94 | 94 | public function getResponse(): ResponseInterface |
| 95 | 95 | { |
| 96 | - if(!$this->xResponse) |
|
| 96 | + if (!$this->xResponse) |
|
| 97 | 97 | { |
| 98 | 98 | $this->xResponse = $this->di->getResponse(); |
| 99 | 99 | } |
@@ -114,21 +114,21 @@ discard block |
||
| 114 | 114 | */ |
| 115 | 115 | public function append(ResponseInterface $xResponse) |
| 116 | 116 | { |
| 117 | - if(!$this->xResponse) |
|
| 117 | + if (!$this->xResponse) |
|
| 118 | 118 | { |
| 119 | 119 | $this->xResponse = $this->di->getResponse(); |
| 120 | 120 | } |
| 121 | - if($this->xResponse->getCommandCount() === 0) |
|
| 121 | + if ($this->xResponse->getCommandCount() === 0) |
|
| 122 | 122 | { |
| 123 | 123 | $this->xResponse = $xResponse; |
| 124 | 124 | return; |
| 125 | 125 | } |
| 126 | - if(get_class($this->xResponse) !== get_class($xResponse)) |
|
| 126 | + if (get_class($this->xResponse) !== get_class($xResponse)) |
|
| 127 | 127 | { |
| 128 | 128 | throw new RequestException($this->xTranslator->trans('errors.mismatch.types', |
| 129 | 129 | ['class' => get_class($xResponse)])); |
| 130 | 130 | } |
| 131 | - if($this->xResponse !== $xResponse) |
|
| 131 | + if ($this->xResponse !== $xResponse) |
|
| 132 | 132 | { |
| 133 | 133 | $this->xResponse->appendResponse($xResponse); |
| 134 | 134 | } |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | */ |
| 170 | 170 | public function printDebug() |
| 171 | 171 | { |
| 172 | - foreach($this->aDebugMessages as $sMessage) |
|
| 172 | + foreach ($this->aDebugMessages as $sMessage) |
|
| 173 | 173 | { |
| 174 | 174 | $this->getResponse()->debug($sMessage); |
| 175 | 175 | } |
@@ -183,8 +183,7 @@ discard block |
||
| 183 | 183 | */ |
| 184 | 184 | public function getContentType(): string |
| 185 | 185 | { |
| 186 | - return empty($this->sCharacterEncoding) ? $this->getResponse()->getContentType() : |
|
| 187 | - $this->getResponse()->getContentType() . '; charset="' . $this->sCharacterEncoding . '"'; |
|
| 186 | + return empty($this->sCharacterEncoding) ? $this->getResponse()->getContentType() : $this->getResponse()->getContentType() . '; charset="' . $this->sCharacterEncoding . '"'; |
|
| 188 | 187 | } |
| 189 | 188 | |
| 190 | 189 | /** |
@@ -94,7 +94,7 @@ |
||
| 94 | 94 | public function redirect(string $sURL, int $nDelay = 0): Response |
| 95 | 95 | { |
| 96 | 96 | $sURL = $this->xPluginManager->getParameterReader()->parseUrl($sURL); |
| 97 | - if($nDelay <= 0) |
|
| 97 | + if ($nDelay <= 0) |
|
| 98 | 98 | { |
| 99 | 99 | return $this->script("window.location = '$sURL';"); |
| 100 | 100 | } |