Skip to content

Commit

Permalink
hide json on success
Browse files Browse the repository at this point in the history
  • Loading branch information
danepowell committed Nov 18, 2024
1 parent 1301436 commit 49b449b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/Command/Api/ApiBaseCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ protected function interact(InputInterface $input, OutputInterface $output): voi
parent::interact($input, $output);
}

/**
* @throws \Acquia\Cli\Exception\AcquiaCliException
* @throws \JsonException
*/
protected function execute(InputInterface $input, OutputInterface $output): int
{
if ($this->getName() === 'api:base') {
Expand Down Expand Up @@ -124,10 +128,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$exitCode = 1;
}

$contents = json_encode($response, JSON_THROW_ON_ERROR | JSON_PRETTY_PRINT);
$this->output->writeln($contents);

if ($exitCode || !$this->getParamFromInput($input, 'task-wait')) {

Check warning on line 131 in src/Command/Api/ApiBaseCommand.php

View workflow job for this annotation

GitHub Actions / Mutation Testing

Escaped Mutant for Mutator "LogicalOrSingleSubExprNegation": --- Original +++ New @@ @@ $response = $exception->getResponseBody(); $exitCode = 1; } - if ($exitCode || !$this->getParamFromInput($input, 'task-wait')) { + if (!$exitCode || !$this->getParamFromInput($input, 'task-wait')) { $contents = json_encode($response, JSON_THROW_ON_ERROR | JSON_PRETTY_PRINT); $this->output->writeln($contents); return $exitCode;
$contents = json_encode($response, JSON_THROW_ON_ERROR | JSON_PRETTY_PRINT);

Check warning on line 132 in src/Command/Api/ApiBaseCommand.php

View workflow job for this annotation

GitHub Actions / Mutation Testing

Escaped Mutant for Mutator "BitwiseOr": --- Original +++ New @@ @@ $exitCode = 1; } if ($exitCode || !$this->getParamFromInput($input, 'task-wait')) { - $contents = json_encode($response, JSON_THROW_ON_ERROR | JSON_PRETTY_PRINT); + $contents = json_encode($response, JSON_THROW_ON_ERROR & JSON_PRETTY_PRINT); $this->output->writeln($contents); return $exitCode; }
$this->output->writeln($contents);
return $exitCode;
}
$notificationUuid = CommandBase::getNotificationUuidFromResponse($response);
Expand Down

0 comments on commit 49b449b

Please sign in to comment.