Skip to content

Commit

Permalink
Merge pull request #573 from fredden/feature/psalm-upgrade-new-rules/…
Browse files Browse the repository at this point in the history
…InvalidOperand

Avoid InvalidOperand error from psalm
  • Loading branch information
Ocramius authored Feb 20, 2025
2 parents b44ad3c + 5c7423d commit 5d5b8e0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/ComposerRequireChecker/Cli/CheckCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,13 @@ protected function execute(InputInterface $input, OutputInterface $output): int
(new LocateDefinedSymbolsFromComposerRuntimeApi())->__invoke($composerData),
);

$this->verbose('found ' . count($definedVendorSymbols) . ' symbols.', $output, true);
$this->verbose(sprintf('found %d symbols.', count($definedVendorSymbols)), $output, true);

$this->verbose('Collecting defined extension symbols... ', $output);
$definedExtensionSymbols = (new LocateDefinedSymbolsFromExtensions())->__invoke(
(new DefinedExtensionsResolver())->__invoke($composerJson, $options->getPhpCoreExtensions()),
);
$this->verbose('found ' . count($definedExtensionSymbols) . ' symbols.', $output, true);
$this->verbose(sprintf('found %d symbols.', count($definedExtensionSymbols)), $output, true);

$this->verbose('Collecting used symbols... ', $output);
$usedSymbols = (new LocateUsedSymbolsFromASTRoots())->__invoke(
Expand All @@ -161,7 +161,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
),
),
);
$this->verbose('found ' . count($usedSymbols) . ' symbols.', $output, true);
$this->verbose(sprintf('found %d symbols.', count($usedSymbols)), $output, true);

if (! count($usedSymbols)) {
throw new LogicException('There were no symbols found, please check your configuration.');
Expand Down
3 changes: 2 additions & 1 deletion src/ComposerRequireChecker/Cli/ResultsWriter/CliText.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

use function count;
use function implode;
use function sprintf;

final class CliText implements ResultsWriter
{
Expand All @@ -36,7 +37,7 @@ public function write(array $unknownSymbols): void
return;
}

$this->output->writeln('The following ' . count($unknownSymbols) . ' unknown symbols were found:');
$this->output->writeln(sprintf('The following %d unknown symbols were found:', count($unknownSymbols)));

$tableOutput = new BufferedOutput();
$table = new Table($tableOutput);
Expand Down

0 comments on commit 5d5b8e0

Please sign in to comment.