Skip to content

Commit

Permalink
NGSTACK-938 fix phpstan only booleans allowed in ternary operator con…
Browse files Browse the repository at this point in the history
…dition
  • Loading branch information
JakovKnezovicc committed Dec 13, 2024
1 parent a34ce0a commit 3bb02e4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Action/CheckPrettier.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,12 @@ protected function doExecute(Config $config, IO $io, Repository $repository, Act
$result = $this->checkPrettier($file->getPath(), $prettierCommand, $formatOptions);

$io->write(sprintf('<info>%s: </info>', $file->getPath()));
$result['success'] ? $io->write($result['output']) : $io->writeError(sprintf('<error>%s</error>', $result['error']));

if ($result['success']) {

Check failure on line 48 in src/Action/CheckPrettier.php

View workflow job for this annotation

GitHub Actions / phpstan

Only booleans are allowed in an if condition, mixed given.
$io->write($result['output']);
} else {
$io->writeError(sprintf('<error>%s</error>', $result['error']));
}

if ($result['success'] !== true) {
$this->throwError($action, $io);
Expand Down

0 comments on commit 3bb02e4

Please sign in to comment.