Skip to content

Commit

Permalink
[TASK] Move RemovedAndAddedFilesCollector (#9)
Browse files Browse the repository at this point in the history
Resolves: #6402
  • Loading branch information
sabbelasichon committed May 11, 2021
1 parent 0684911 commit a09d515
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 4 additions & 0 deletions src/Application/ApplicationFileProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -21,6 +22,7 @@ public function __construct(
private SmartFileSystem $smartFileSystem,
private FileDiffFileDecorator $fileDiffFileDecorator,
private FileFormatter $fileFormatter,
private RemovedAndAddedFilesProcessor $removedAndAddedFilesProcessor,
private array $fileProcessors = []
) {
}
Expand Down Expand Up @@ -51,6 +53,8 @@ private function processFiles(array $files): void

$fileProcessor->process($supportedFiles);
}

$this->removedAndAddedFilesProcessor->run();
}

/**
Expand Down
5 changes: 0 additions & 5 deletions src/Application/FileProcessor/PhpFileProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,13 @@ public function __construct(
private FormatPerservingPrinter $formatPerservingPrinter,
private FileProcessor $fileProcessor,
private RemovedAndAddedFilesCollector $removedAndAddedFilesCollector,
private RemovedAndAddedFilesProcessor $removedAndAddedFilesProcessor,
private SymfonyStyle $symfonyStyle,
private PrivatesAccessor $privatesAccessor,
private FileDiffFileDecorator $fileDiffFileDecorator,
private CurrentFileProvider $currentFileProvider,
private PostFileProcessor $postFileProcessor,
private ErrorFactory $errorFactory
) {
$this->configuration = $configuration;
}

/**
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit a09d515

Please sign in to comment.