Skip to content

Commit

Permalink
number
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed Feb 15, 2024
1 parent 591898d commit 13a2213
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Command/FindMultiClassesCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Rector\SwissKnife\Command;

use Rector\SwissKnife\Finder\MultipleClassInOneFileFinder;
use Rector\SwissKnife\Finder\PhpFilesFinder;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
Expand Down Expand Up @@ -38,9 +39,11 @@ protected function execute(InputInterface $input, OutputInterface $output): int
/** @var string[] $source */
$source = $input->getArgument('sources');

$phpFileInfos = PhpFilesFinder::find($source);

$multipleClassesByFile = $this->multipleClassInOneFileFinder->findInDirectories($source);
if ($multipleClassesByFile === []) {
$this->symfonyStyle->success('No files with 2+ classes found');
$this->symfonyStyle->success(sprintf('No file with 2+ classes found in %d files', count($phpFileInfos)));

return self::SUCCESS;
}
Expand Down

0 comments on commit 13a2213

Please sign in to comment.