Skip to content

Commit

Permalink
[show] skip system post rectors in show command
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed May 6, 2021
1 parent de37a73 commit 812ff5b
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/Console/Command/ShowCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

use Rector\Core\Configuration\Option;
use Rector\Core\Contract\Rector\RectorInterface;
use Rector\PostRector\Application\PostFileProcessor;
use Rector\PostRector\Contract\Rector\PostRectorInterface;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
Expand Down Expand Up @@ -58,12 +60,16 @@ protected function execute(InputInterface $input, OutputInterface $output): int

private function reportLoadedRectors(): void
{
$rectorCount = count($this->rectors);
$rectors = array_filter($this->rectors, function (RectorInterface $rector) {
return ! $rector instanceof PostRectorInterface;
});

$rectorCount = count($rectors);

if ($rectorCount > 0) {
$this->symfonyStyle->title('Loaded Rector rules');

foreach ($this->rectors as $rector) {
foreach ($rectors as $rector) {
$this->symfonyStyle->writeln(' * ' . get_class($rector));
}

Expand Down

0 comments on commit 812ff5b

Please sign in to comment.