Skip to content

Commit bd6ab5d

Browse files
authored
Merge pull request #10 from Tiime-Software/fix-baseline-max-route
Simplify conditions and fix generate baseline
2 parents 2dac939 + 63f4923 commit bd6ab5d

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

src/Command/CheckCommand.php

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -73,20 +73,13 @@ protected function execute(InputInterface $input, OutputInterface $output): int
7373
/* @phpstan-ignore-next-line */
7474
$max = (int) $input->getOption('maximum-routes-to-display');
7575

76-
if ($count < $max) {
77-
$io->listing($untestedRoutes);
78-
79-
$io->error(sprintf('Found %d non tested route%s!', $count, 1 === $count ? '' : 's'));
80-
81-
$this->showTestedIgnoredRoutesSection($io, $testedIgnoredRoutes);
76+
$io->listing(\array_slice($untestedRoutes, 0, $max));
8277

83-
return Command::FAILURE;
78+
if ($count > $max) {
79+
$io->writeln(sprintf('... and %d more', $count - $max));
8480
}
8581

86-
$io->listing(\array_slice($untestedRoutes, 0, $max));
87-
$io->writeln(sprintf('... and %d more', $count - $max));
88-
89-
$io->error("Found $count non tested routes!");
82+
$io->error(sprintf('Found %d non tested route%s!', $count, 1 === $count ? '' : 's'));
9083

9184
$this->showTestedIgnoredRoutesSection($io, $testedIgnoredRoutes);
9285

@@ -95,7 +88,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
9588
->saveRoute(
9689
implode(\PHP_EOL, $untestedRoutes)
9790
);
98-
$io->writeln('Results saved in '.$routesToIgnoreFile);
91+
$io->writeln(sprintf('Results saved in %s', $routesToIgnoreFile));
9992
}
10093

10194
return Command::FAILURE;

0 commit comments

Comments
 (0)