-
-
Notifications
You must be signed in to change notification settings - Fork 64
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
Maintenance #389
Maintenance #389
Conversation
830bd1a
to
42922a0
Compare
/** | ||
* {@inheritDoc} | ||
* | ||
* @psalm-external-mutation-free |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PHPStan apparently doesn't understand that annotation, but then again, it does not complain when it is gone.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand why it was used for those getters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
phpstan memoizes getters by default unless tagged with @phpstan-impure
, while psalm does not. This @psalm-external-mutation-free
is required for Psalm to consider that calling a method does not mutate other things and so it can remember refinements it did for calls.
* @psalm-suppress ArgumentTypeCoercion | ||
* @psalm-suppress UndefinedClass | ||
* @phpstan-suppress ArgumentTypeCoercion | ||
* @phpstan-suppress UndefinedClass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suppressing a psalm error with a phpstan-suppress annotation does not make any sense. @phpstan-suppress
does not exist (the equivalent feature in phpstan uses the @phpstan-ignore-*
tags, as used just below)
/** | ||
* {@inheritDoc} | ||
* | ||
* @psalm-external-mutation-free |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
phpstan memoizes getters by default unless tagged with @phpstan-impure
, while psalm does not. This @psalm-external-mutation-free
is required for Psalm to consider that calling a method does not mutate other things and so it can remember refinements it did for calls.
No description provided.