Skip to content

Commit

Permalink
[Core] Move currentFileProvider->setFile() early before loop on PhpFi…
Browse files Browse the repository at this point in the history
…leProcessor::process() (#3006)
  • Loading branch information
samsonasik committed Oct 22, 2022
1 parent befc544 commit 1dcd9fa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Application/FileProcessor/PhpFileProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ public function process(File $file, Configuration $configuration): array
return $systemErrorsAndFileDiffs;
}

$this->currentFileProvider->setFile($file);

// 2. change nodes with Rectors
do {
$file->changeHasChanged(false);
Expand All @@ -69,8 +71,6 @@ public function process(File $file, Configuration $configuration): array
$file->changeNewStmts($newStmts);

// 4. print to file or string
$this->currentFileProvider->setFile($file);

// important to detect if file has changed
$this->printFile($file, $configuration);
} while ($file->hasChanged());
Expand Down

0 comments on commit 1dcd9fa

Please sign in to comment.