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

[DeadCode] Handle file_get_contents() only remove variable on RemoveUnusedVariableAssignRector #5162

Merged
merged 1 commit into from Oct 13, 2023

Conversation

samsonasik
Copy link
Member

@samsonasik
Copy link
Member Author

Fixed 🎉 /cc @staabm

@@ -33,6 +33,8 @@ final class PureFunctionDetector
// http
'header', 'header_remove', 'http_response_code', 'setcookie',

'file_get_contents',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ohh nice, didn't realize we have such a list. PHPStan also has such a list.. maybe we can utilize the hasSideEffects methods of the different Reflection*-classes?

https://github.com/search?q=repo%3Aphpstan%2Fphpstan-src%20hasSideEffects&type=code

if we would trust PHPStans list, we would not need to duplicate that list in rector itself

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, phpstan has very limited list, while psalm has more list, so it use list form psalm, if we can have script to make both tools collect more list on each other, that would be awesome :)

@samsonasik
Copy link
Member Author

All checks have passed 🎉 @TomasVotruba I am merging it ;)

@samsonasik samsonasik merged commit 2efd6d5 into main Oct 13, 2023
41 checks passed
@samsonasik samsonasik deleted the file-get branch October 13, 2023 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants