@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | */ |
127 | 127 | protected function str($xData): string |
128 | 128 | { |
129 | - return trim((string)$xData, " \t\n"); |
|
129 | + return trim((string) $xData, " \t\n"); |
|
130 | 130 | } |
131 | 131 | |
132 | 132 | /** |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | public function toPsr(): PsrResponseInterface |
186 | 186 | { |
187 | 187 | $xPsrResponse = $this->xPsr17Factory->createResponse(200); |
188 | - if($this->xRequest->getMethod() === 'GET') |
|
188 | + if ($this->xRequest->getMethod() === 'GET') |
|
189 | 189 | { |
190 | 190 | $xPsrResponse = $xPsrResponse |
191 | 191 | ->withHeader('Expires', 'Mon, 26 Jul 1997 05:00:00 GMT') |
@@ -69,8 +69,7 @@ discard block |
||
69 | 69 | public function appendCommands(array $aCommands, bool $bBefore = false) |
70 | 70 | { |
71 | 71 | $this->aCommands = ($bBefore) ? |
72 | - array_merge($aCommands, $this->aCommands) : |
|
73 | - array_merge($this->aCommands, $aCommands); |
|
72 | + array_merge($aCommands, $this->aCommands) : array_merge($this->aCommands, $aCommands); |
|
74 | 73 | } |
75 | 74 | |
76 | 75 | /** |
@@ -94,7 +93,7 @@ discard block |
||
94 | 93 | * |
95 | 94 | * @return ResponseInterface |
96 | 95 | */ |
97 | - public function addCommand(string $sName, array|JsonSerializable $aOptions): ResponseInterface |
|
96 | + public function addCommand(string $sName, array | JsonSerializable $aOptions): ResponseInterface |
|
98 | 97 | { |
99 | 98 | $this->aCommands[] = [ |
100 | 99 | 'name' => $this->str($sName), |
@@ -113,7 +112,7 @@ discard block |
||
113 | 112 | * @return ResponseInterface |
114 | 113 | */ |
115 | 114 | public function addPluginCommand(ResponsePlugin $xPlugin, string $sName, |
116 | - array|JsonSerializable $aOptions): ResponseInterface |
|
115 | + array | JsonSerializable $aOptions): ResponseInterface |
|
117 | 116 | { |
118 | 117 | $this->aCommands[] = [ |
119 | 118 | 'name' => $this->str($sName), |
@@ -132,10 +131,10 @@ discard block |
||
132 | 131 | * |
133 | 132 | * @return ResponseInterface |
134 | 133 | */ |
135 | - protected function _addCommand(string $sName, array|JsonSerializable $aOptions, |
|
134 | + protected function _addCommand(string $sName, array | JsonSerializable $aOptions, |
|
136 | 135 | bool $bRemoveEmpty = false): ResponseInterface |
137 | 136 | { |
138 | - if($bRemoveEmpty) |
|
137 | + if ($bRemoveEmpty) |
|
139 | 138 | { |
140 | 139 | $aOptions = array_filter($aOptions, function($xOption) { |
141 | 140 | return $xOption === ''; |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | { |
169 | 169 | $sName = $this->sPath ?? 'this'; |
170 | 170 | $aCall = ['_type' => 'select', '_name' => $sName]; |
171 | - if(($this->xContext)) |
|
171 | + if (($this->xContext)) |
|
172 | 172 | { |
173 | 173 | $aCall['context'] = $this->xContext; |
174 | 174 | } |
@@ -181,16 +181,16 @@ discard block |
||
181 | 181 | public function toArray(): array |
182 | 182 | { |
183 | 183 | $aCalls = [$this->selector()]; |
184 | - foreach($this->aCalls as $xCall) |
|
184 | + foreach ($this->aCalls as $xCall) |
|
185 | 185 | { |
186 | 186 | $aCalls[] = $xCall->jsonSerialize(); |
187 | 187 | } |
188 | - if($this->bToInt) |
|
188 | + if ($this->bToInt) |
|
189 | 189 | { |
190 | 190 | $aCalls[] = [ |
191 | 191 | '_type' => 'func', |
192 | 192 | '_name' => 'toInt', |
193 | - 'args' => [[ '_type' => '_', '_name' => 'this' ]], |
|
193 | + 'args' => [['_type' => '_', '_name' => 'this']], |
|
194 | 194 | ]; |
195 | 195 | } |
196 | 196 | return ['_type' => 'expr', 'calls' => $aCalls]; |
@@ -302,15 +302,15 @@ discard block |
||
302 | 302 | public function toArray(): array |
303 | 303 | { |
304 | 304 | $aCall = parent::toArray(); |
305 | - if(($this->aConfirm)) |
|
305 | + if (($this->aConfirm)) |
|
306 | 306 | { |
307 | 307 | $aCall['question'] = $this->aConfirm; |
308 | 308 | } |
309 | - if(($this->aCondition)) |
|
309 | + if (($this->aCondition)) |
|
310 | 310 | { |
311 | 311 | $aCall['condition'] = $this->aCondition; |
312 | 312 | } |
313 | - if(($this->aMessage)) |
|
313 | + if (($this->aMessage)) |
|
314 | 314 | { |
315 | 315 | $aCall['message'] = $this->aMessage; |
316 | 316 | } |
@@ -324,9 +324,9 @@ discard block |
||
324 | 324 | */ |
325 | 325 | private function findPageNumber(): ?ParameterInterface |
326 | 326 | { |
327 | - foreach($this->aParameters as $xParameter) |
|
327 | + foreach ($this->aParameters as $xParameter) |
|
328 | 328 | { |
329 | - if($xParameter->getType() === Parameter::PAGE_NUMBER) |
|
329 | + if ($xParameter->getType() === Parameter::PAGE_NUMBER) |
|
330 | 330 | { |
331 | 331 | return $xParameter; |
332 | 332 | } |
@@ -355,7 +355,7 @@ discard block |
||
355 | 355 | { |
356 | 356 | /** @var Parameter */ |
357 | 357 | $xParameter = $this->findPageNumber(); |
358 | - if($xParameter !== null) |
|
358 | + if ($xParameter !== null) |
|
359 | 359 | { |
360 | 360 | $xParameter->setValue($nPageNumber); |
361 | 361 | } |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | */ |
124 | 124 | public function addParameters(array $aParameters): JsCall |
125 | 125 | { |
126 | - foreach($aParameters as $xParameter) |
|
126 | + foreach ($aParameters as $xParameter) |
|
127 | 127 | { |
128 | 128 | $this->pushParameter(Parameter::make($xParameter)); |
129 | 129 | } |
@@ -144,12 +144,12 @@ discard block |
||
144 | 144 | return $xParam->jsonSerialize(); |
145 | 145 | }, $this->aParameters), |
146 | 146 | ]]; |
147 | - if($this->bToInt) |
|
147 | + if ($this->bToInt) |
|
148 | 148 | { |
149 | 149 | $aCalls[] = [ |
150 | 150 | '_type' => 'func', |
151 | 151 | '_name' => 'toInt', |
152 | - 'args' => [[ '_type' => '_', '_name' => 'this' ]], |
|
152 | + 'args' => [['_type' => '_', '_name' => 'this']], |
|
153 | 153 | ]; |
154 | 154 | } |
155 | 155 | return ['_type' => 'expr', 'calls' => $aCalls]; |