@@ -71,7 +71,7 @@ |
||
| 71 | 71 | * |
| 72 | 72 | * @return void |
| 73 | 73 | */ |
| 74 | - public function addCommand(string $sName, array|JsonSerializable $aOptions) |
|
| 74 | + public function addCommand(string $sName, array | JsonSerializable $aOptions) |
|
| 75 | 75 | { |
| 76 | 76 | $this->xResponse->addPluginCommand($this, $sName, $aOptions); |
| 77 | 77 | } |
@@ -86,8 +86,7 @@ discard block |
||
| 86 | 86 | */ |
| 87 | 87 | public function getOutput(): string |
| 88 | 88 | { |
| 89 | - return $this->getCommandCount() === 0 ? '{}' : |
|
| 90 | - json_encode(['jxnobj' => $this->aCommands]); |
|
| 89 | + return $this->getCommandCount() === 0 ? '{}' : json_encode(['jxnobj' => $this->aCommands]); |
|
| 91 | 90 | } |
| 92 | 91 | |
| 93 | 92 | /** |
@@ -189,7 +188,7 @@ discard block |
||
| 189 | 188 | public function toPsr(): PsrResponseInterface |
| 190 | 189 | { |
| 191 | 190 | $xPsrResponse = $this->xPsr17Factory->createResponse(200); |
| 192 | - if($this->xRequest->getMethod() === 'GET') |
|
| 191 | + if ($this->xRequest->getMethod() === 'GET') |
|
| 193 | 192 | { |
| 194 | 193 | $xPsrResponse = $xPsrResponse |
| 195 | 194 | ->withHeader('Expires', 'Mon, 26 Jul 1997 05:00:00 GMT') |
@@ -17,14 +17,14 @@ |
||
| 17 | 17 | |
| 18 | 18 | trait HtmlDomTrait |
| 19 | 19 | { |
| 20 | - /** |
|
| 21 | - * Add a response command to the array of commands that will be sent to the browser |
|
| 22 | - * |
|
| 23 | - * @param string $sName The command name |
|
| 24 | - * @param array|JsonSerializable $aOptions The command options |
|
| 25 | - * |
|
| 26 | - * @return ResponseInterface |
|
| 27 | - */ |
|
| 20 | + /** |
|
| 21 | + * Add a response command to the array of commands that will be sent to the browser |
|
| 22 | + * |
|
| 23 | + * @param string $sName The command name |
|
| 24 | + * @param array|JsonSerializable $aOptions The command options |
|
| 25 | + * |
|
| 26 | + * @return ResponseInterface |
|
| 27 | + */ |
|
| 28 | 28 | abstract public function addCommand(string $sName, array|JsonSerializable $aOptions): ResponseInterface; |
| 29 | 29 | |
| 30 | 30 | /** |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | * |
| 26 | 26 | * @return ResponseInterface |
| 27 | 27 | */ |
| 28 | - abstract public function addCommand(string $sName, array|JsonSerializable $aOptions): ResponseInterface; |
|
| 28 | + abstract public function addCommand(string $sName, array | JsonSerializable $aOptions): ResponseInterface; |
|
| 29 | 29 | |
| 30 | 30 | /** |
| 31 | 31 | * Add a command to assign the specified value to the given element's attribute |
@@ -61,8 +61,7 @@ discard block |
||
| 61 | 61 | public function appendCommands(array $aCommands, bool $bBefore = false) |
| 62 | 62 | { |
| 63 | 63 | $this->aCommands = ($bBefore) ? |
| 64 | - array_merge($aCommands, $this->aCommands) : |
|
| 65 | - array_merge($this->aCommands, $aCommands); |
|
| 64 | + array_merge($aCommands, $this->aCommands) : array_merge($this->aCommands, $aCommands); |
|
| 66 | 65 | } |
| 67 | 66 | |
| 68 | 67 | /** |
@@ -86,7 +85,7 @@ discard block |
||
| 86 | 85 | * |
| 87 | 86 | * @return ResponseInterface |
| 88 | 87 | */ |
| 89 | - public function addCommand(string $sName, array|JsonSerializable $aOptions): ResponseInterface |
|
| 88 | + public function addCommand(string $sName, array | JsonSerializable $aOptions): ResponseInterface |
|
| 90 | 89 | { |
| 91 | 90 | $this->aCommands[] = [ |
| 92 | 91 | 'cmd' => $this->str($sName), |
@@ -105,7 +104,7 @@ discard block |
||
| 105 | 104 | * @return ResponseInterface |
| 106 | 105 | */ |
| 107 | 106 | public function addPluginCommand(ResponsePlugin $xPlugin, string $sName, |
| 108 | - array|JsonSerializable $aOptions): ResponseInterface |
|
| 107 | + array | JsonSerializable $aOptions): ResponseInterface |
|
| 109 | 108 | { |
| 110 | 109 | $this->aCommands[] = [ |
| 111 | 110 | 'cmd' => $this->str($sName), |
@@ -124,7 +123,7 @@ discard block |
||
| 124 | 123 | */ |
| 125 | 124 | protected function str($xData): string |
| 126 | 125 | { |
| 127 | - return trim((string)$xData, " \t\n"); |
|
| 126 | + return trim((string) $xData, " \t\n"); |
|
| 128 | 127 | } |
| 129 | 128 | |
| 130 | 129 | /** |
@@ -136,10 +135,10 @@ discard block |
||
| 136 | 135 | * |
| 137 | 136 | * @return ResponseInterface |
| 138 | 137 | */ |
| 139 | - protected function _addCommand(string $sName, array|JsonSerializable $aOptions, |
|
| 138 | + protected function _addCommand(string $sName, array | JsonSerializable $aOptions, |
|
| 140 | 139 | bool $bRemoveEmpty = false): ResponseInterface |
| 141 | 140 | { |
| 142 | - if($bRemoveEmpty) |
|
| 141 | + if ($bRemoveEmpty) |
|
| 143 | 142 | { |
| 144 | 143 | $aOptions = array_filter($aOptions, function($xOption) { |
| 145 | 144 | return $xOption === ''; |
@@ -20,14 +20,14 @@ |
||
| 20 | 20 | |
| 21 | 21 | trait ScriptTrait |
| 22 | 22 | { |
| 23 | - /** |
|
| 24 | - * Add a response command to the array of commands that will be sent to the browser |
|
| 25 | - * |
|
| 26 | - * @param string $sName The command name |
|
| 27 | - * @param array|JsonSerializable $aOptions The command options |
|
| 28 | - * |
|
| 29 | - * @return ResponseInterface |
|
| 30 | - */ |
|
| 23 | + /** |
|
| 24 | + * Add a response command to the array of commands that will be sent to the browser |
|
| 25 | + * |
|
| 26 | + * @param string $sName The command name |
|
| 27 | + * @param array|JsonSerializable $aOptions The command options |
|
| 28 | + * |
|
| 29 | + * @return ResponseInterface |
|
| 30 | + */ |
|
| 31 | 31 | abstract public function addCommand(string $sName, array|JsonSerializable $aOptions): ResponseInterface; |
| 32 | 32 | |
| 33 | 33 | /** |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | * |
| 29 | 29 | * @return ResponseInterface |
| 30 | 30 | */ |
| 31 | - abstract public function addCommand(string $sName, array|JsonSerializable $aOptions): ResponseInterface; |
|
| 31 | + abstract public function addCommand(string $sName, array | JsonSerializable $aOptions): ResponseInterface; |
|
| 32 | 32 | |
| 33 | 33 | /** |
| 34 | 34 | * Response command that prompts user with [ok] [cancel] style message box |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | { |
| 61 | 61 | $aArgs = func_get_args(); |
| 62 | 62 | array_shift($aArgs); |
| 63 | - return $this->addCommand('jc', ['func' => $this->str($sFunc),'args' => $aArgs]); |
|
| 63 | + return $this->addCommand('jc', ['func' => $this->str($sFunc), 'args' => $aArgs]); |
|
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | /** |
@@ -73,7 +73,7 @@ |
||
| 73 | 73 | * @return ResponseInterface |
| 74 | 74 | */ |
| 75 | 75 | public function addPluginCommand(ResponsePlugin $xPlugin, string $sName, |
| 76 | - array|JsonSerializable $aOptions): ResponseInterface; |
|
| 76 | + array | JsonSerializable $aOptions): ResponseInterface; |
|
| 77 | 77 | |
| 78 | 78 | /** |
| 79 | 79 | * Convert this response to a PSR7 response object |
@@ -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' => 'jaxon.utils.string.toInt', |
| 152 | - 'params' => [[ '_type' => '_', '_name' => 'this' ]], |
|
| 152 | + 'params' => [['_type' => '_', '_name' => 'this']], |
|
| 153 | 153 | ]; |
| 154 | 154 | } |
| 155 | 155 | return [ |