Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Core] Improve performance: remove repetitive currentFileProvider->setFile() call on PhpFileProcessor #3213

Merged
merged 2 commits into from Dec 17, 2022

Conversation

samsonasik
Copy link
Member

@samsonasik samsonasik commented Dec 17, 2022

There is already initialization early of $this->currentFileProvider->setFile($file); when call:

$parsingSystemErrors = $this->parseFileAndDecorateNodes($file);

in parseFileAndDecorateNodes() method:

private function parseFileAndDecorateNodes(File $file): array
{
$this->currentFileProvider->setFile($file);

so, next calls no longer needed as already set early.

so:

✔️ Remove 2 unused call $this->currentFileProvider->setFile($file);
✔️ Remove unused private method that only call another method, just use as is directly:

$this->fileProcessor->refactor($file, $configuration)

as it only do that now.

@samsonasik
Copy link
Member Author

All checks have passed 🎉 @TomasVotruba it is ready for review.

@TomasVotruba TomasVotruba merged commit e895bce into main Dec 17, 2022
@TomasVotruba TomasVotruba deleted the core-remove-repetitive-setfile branch December 17, 2022 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants