Skip to content

Conversation

@b1rdex
Copy link
Contributor

@b1rdex b1rdex commented Dec 25, 2020

  1. CallToFunctionStamentWithoutSideEffectsRuleTest doesn't find errors and I don't know how to fix it. Running analysis with bin/phpstan finds them correctly.
  2. This needs more rules to check the bodies of @pure functions/methods for purity. I think this might be postponed for now and solved in the future.
  3. This needs documenting, but I'd rather prefer not to write it myself. I'm not a native speaker :)
Copy link
Member

@ondrejmirtes ondrejmirtes left a comment

Choose a reason for hiding this comment

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

Thank you, I appreciate this. Although there's much more work that needs to be done, I don't want to be exactly 1:1 with Psalm as this area is very complicated. I consider "pure" functions to consist of two attributes - hasSideEffects, and isDeterministic. We can find examples of functions and methods in all 4 brackets - yes/yes, yes/no, no/yes, no/no. And they behave differently and different situations, which will influence the analysis.

@b1rdex
Copy link
Contributor Author

b1rdex commented Dec 28, 2020

@b1rdex b1rdex requested a review from ondrejmirtes January 10, 2021 15:18
@ondrejmirtes
Copy link
Member

Added a commit with backwards compatibility and also the ability to set "impure" functions: c99316d

@ondrejmirtes ondrejmirtes merged commit 21db379 into phpstan:master Jan 11, 2021
@ondrejmirtes
Copy link
Member

@b1rdex Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants