Skip to content

Commit

Permalink
Renamed response fields.
Browse files Browse the repository at this point in the history
  • Loading branch information
feuzeu committed May 12, 2024
1 parent dec8cc3 commit db866e5
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/Response/Traits/CommandTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,15 @@ public function appendResponse(ResponseInterface $xResponse, bool $bBefore = fal
* Add a response command to the array of commands that will be sent to the browser
*
* @param string $sName The command name
* @param array|JsonSerializable $aOptions The command options
* @param array|JsonSerializable $aArgs The command arguments
*
* @return ResponseInterface
*/
public function addCommand(string $sName, array|JsonSerializable $aOptions): ResponseInterface
public function addCommand(string $sName, array|JsonSerializable $aArgs): ResponseInterface
{
$this->aCommands[] = [
'name' => $this->str($sName),
'options' => $aOptions,
'args' => $aArgs,
];
return $this;
}
Expand All @@ -108,17 +108,17 @@ public function addCommand(string $sName, array|JsonSerializable $aOptions): Res
*
* @param ResponsePlugin $xPlugin The plugin object
* @param string $sName The command name
* @param array|JsonSerializable $aOptions The command options
* @param array|JsonSerializable $aArgs The command arguments
*
* @return ResponseInterface
*/
public function addPluginCommand(ResponsePlugin $xPlugin, string $sName,
array|JsonSerializable $aOptions): ResponseInterface
array|JsonSerializable $aArgs): ResponseInterface
{
$this->aCommands[] = [
'name' => $this->str($sName),
'plugin' => $xPlugin->getName(),
'options' => $aOptions,
'args' => $aArgs,
];
return $this;
}
Expand All @@ -127,20 +127,20 @@ public function addPluginCommand(ResponsePlugin $xPlugin, string $sName,
* Add a response command to the array of commands that will be sent to the browser
*
* @param string $sName The command name
* @param array|JsonSerializable $aOptions The command options
* @param bool $bRemoveEmpty If true, remove empty options
* @param array|JsonSerializable $aArgs The command arguments
* @param bool $bRemoveEmpty If true, remove empty arguments
*
* @return ResponseInterface
*/
protected function _addCommand(string $sName, array|JsonSerializable $aOptions,
protected function _addCommand(string $sName, array|JsonSerializable $aArgs,
bool $bRemoveEmpty = false): ResponseInterface
{
if($bRemoveEmpty)
{
$aOptions = array_filter($aOptions, function($xOption) {
return $xOption === '';
$aArgs = array_filter($aArgs, function($xArg) {
return $xArg === '';
});
}
return $this->addCommand($this->str($sName), $aOptions);
return $this->addCommand($this->str($sName), $aArgs);
}
}

0 comments on commit db866e5

Please sign in to comment.