-
Notifications
You must be signed in to change notification settings - Fork 61
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
rfc flag method as having write operation side effects #14
Comments
@SignpostMarv Hi, I don't see what effect should this have for analysis. Also see: phpstan/phpstan#1157 |
@ondrejmirtes one of the intended effects would be to let an analyser flag particular methods as "MUST have no side effects prior to calling", in the above example this would be additionally, if the since the tl:dr; is regarding operation safety, there's a few patterns in PHP that shouldn't have side effects, and some patterns that should-
for catching developer errors:
|
I had a brief perusal of the phpdocumenter tag list, and there doesn't seem to be a tag for indicating a method has write operation amongst it list of side effects.
The situation I'm thinking of here is some theoretical static analysis for flagging up write operations taking place before some anti-csrf action, i.e. if the token is re-used, no write operations should've taken place, i.e.
write operations in this context do not include simply calling property setters etc.
the hypthetical analysis could also flag methods that're explicitly tagged as being read-only operations that (in a later commit/ composer package update) end up with a write operation in it's AST.
tl:dr; we have tags for type safety, what about operation safety?
The text was updated successfully, but these errors were encountered: