|
20 | 20 | use Rector\Core\ValueObject\Error\SystemError; |
21 | 21 | use Rector\Core\ValueObject\Reporting\FileDiff; |
22 | 22 | use Rector\Parallel\ValueObject\Bridge; |
23 | | -use Rector\Parallel\ValueObject\ProcessFileResult; |
24 | 23 | use Symplify\EasyParallel\Enum\Action; |
25 | 24 | use Symplify\EasyParallel\Enum\ReactCommand; |
26 | 25 | use Symplify\EasyParallel\Enum\ReactEvent; |
@@ -94,12 +93,11 @@ public function run(Encoder $encoder, Decoder $decoder, Configuration $configura |
94 | 93 | $file = new File($filePath, FileSystem::read($filePath)); |
95 | 94 | $this->currentFileProvider->setFile($file); |
96 | 95 |
|
97 | | - $processFileResult = $this->processFile($file, $configuration, $errorAndFileDiffs); |
98 | | - $errorAndFileDiffs = $processFileResult->getErrorAndFileDiffs(); |
| 96 | + $errorAndFileDiffs = $this->processFile($file, $configuration, $errorAndFileDiffs); |
99 | 97 |
|
100 | 98 | if ($errorAndFileDiffs[Bridge::SYSTEM_ERRORS] !== []) { |
101 | 99 | $this->invalidateFile($file); |
102 | | - } elseif (! $configuration->isDryRun() || $processFileResult->isFileChanged()) { |
| 100 | + } else { |
103 | 101 | $this->changedFilesDetector->cacheFileWithDependencies($file->getFilePath()); |
104 | 102 | } |
105 | 103 | } catch (Throwable $throwable) { |
@@ -131,24 +129,23 @@ public function run(Encoder $encoder, Decoder $decoder, Configuration $configura |
131 | 129 |
|
132 | 130 | /** |
133 | 131 | * @param array{system_errors: SystemError[], file_diffs: FileDiff[]}|mixed[] $errorAndFileDiffs |
| 132 | + * @return array{system_errors: SystemError[], file_diffs: FileDiff[]} |
134 | 133 | */ |
135 | | - private function processFile(File $file, Configuration $configuration, array $errorAndFileDiffs): ProcessFileResult |
| 134 | + private function processFile(File $file, Configuration $configuration, array $errorAndFileDiffs): array |
136 | 135 | { |
137 | | - $wasFileChanged = false; |
138 | 136 | foreach ($this->fileProcessors as $fileProcessor) { |
139 | 137 | if (! $fileProcessor->supports($file, $configuration)) { |
140 | 138 | continue; |
141 | 139 | } |
142 | 140 |
|
143 | 141 | $currentErrorsAndFileDiffs = $fileProcessor->process($file, $configuration); |
144 | | - $wasFileChanged = $wasFileChanged || $currentErrorsAndFileDiffs[Bridge::FILE_DIFFS] !== []; |
145 | 142 | $errorAndFileDiffs = $this->arrayParametersMerger->merge( |
146 | 143 | $errorAndFileDiffs, |
147 | 144 | $currentErrorsAndFileDiffs |
148 | 145 | ); |
149 | 146 | } |
150 | 147 |
|
151 | | - return new ProcessFileResult($wasFileChanged, $errorAndFileDiffs); |
| 148 | + return $errorAndFileDiffs; |
152 | 149 | } |
153 | 150 |
|
154 | 151 | /** |
|
0 commit comments