From a09d515233b0f5356a006586e3f26adf5868cbf0 Mon Sep 17 00:00:00 2001 From: Sebastian Schreiber Date: Tue, 11 May 2021 12:38:09 +0200 Subject: [PATCH] [TASK] Move RemovedAndAddedFilesCollector (#9) Resolves: rectorphp/rector#6402 --- src/Application/ApplicationFileProcessor.php | 4 ++++ src/Application/FileProcessor/PhpFileProcessor.php | 5 ----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Application/ApplicationFileProcessor.php b/src/Application/ApplicationFileProcessor.php index be5a5f39b08f..85055adbb581 100644 --- a/src/Application/ApplicationFileProcessor.php +++ b/src/Application/ApplicationFileProcessor.php @@ -5,6 +5,7 @@ namespace Rector\Core\Application; use Rector\Core\Application\FileDecorator\FileDiffFileDecorator; +use Rector\Core\Application\FileSystem\RemovedAndAddedFilesProcessor; use Rector\Core\Configuration\Configuration; use Rector\Core\Contract\Processor\FileProcessorInterface; use Rector\Core\ValueObject\Application\File; @@ -21,6 +22,7 @@ public function __construct( private SmartFileSystem $smartFileSystem, private FileDiffFileDecorator $fileDiffFileDecorator, private FileFormatter $fileFormatter, + private RemovedAndAddedFilesProcessor $removedAndAddedFilesProcessor, private array $fileProcessors = [] ) { } @@ -51,6 +53,8 @@ private function processFiles(array $files): void $fileProcessor->process($supportedFiles); } + + $this->removedAndAddedFilesProcessor->run(); } /** diff --git a/src/Application/FileProcessor/PhpFileProcessor.php b/src/Application/FileProcessor/PhpFileProcessor.php index dcb526b778a2..9f573227d7fc 100644 --- a/src/Application/FileProcessor/PhpFileProcessor.php +++ b/src/Application/FileProcessor/PhpFileProcessor.php @@ -48,7 +48,6 @@ public function __construct( private FormatPerservingPrinter $formatPerservingPrinter, private FileProcessor $fileProcessor, private RemovedAndAddedFilesCollector $removedAndAddedFilesCollector, - private RemovedAndAddedFilesProcessor $removedAndAddedFilesProcessor, private SymfonyStyle $symfonyStyle, private PrivatesAccessor $privatesAccessor, private FileDiffFileDecorator $fileDiffFileDecorator, @@ -56,7 +55,6 @@ public function __construct( private PostFileProcessor $postFileProcessor, private ErrorFactory $errorFactory ) { - $this->configuration = $configuration; } /** @@ -109,9 +107,6 @@ public function process(array $files): void if ($this->configuration->shouldShowProgressBar()) { $this->symfonyStyle->newLine(2); } - - // 4. remove and add files - $this->removedAndAddedFilesProcessor->run(); } public function supports(File $file): bool