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 84770f9 commit dec8cc3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions src/Response/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,7 @@ public function getContentType(): string
*/
public function getOutput(): string
{
return $this->getCommandCount() === 0 ? '{}' :
json_encode(['jxnobj' => $this->aCommands]);
return json_encode(['jxn' => ['commands' => $this->aCommands]]);
}

/**
Expand Down
6 changes: 3 additions & 3 deletions src/Response/Traits/CommandTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public function appendResponse(ResponseInterface $xResponse, bool $bBefore = fal
public function addCommand(string $sName, array|JsonSerializable $aOptions): ResponseInterface
{
$this->aCommands[] = [
'cmd' => $this->str($sName),
'name' => $this->str($sName),
'options' => $aOptions,
];
return $this;
Expand All @@ -116,8 +116,8 @@ public function addPluginCommand(ResponsePlugin $xPlugin, string $sName,
array|JsonSerializable $aOptions): ResponseInterface
{
$this->aCommands[] = [
'cmd' => $this->str($sName),
'plg' => $xPlugin->getName(),
'name' => $this->str($sName),
'plugin' => $xPlugin->getName(),
'options' => $aOptions,
];
return $this;
Expand Down

0 comments on commit dec8cc3

Please sign in to comment.