We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
It looks like the @readonly restriction is picked up, but not the @psalm-allow-private-mutation exception.
@readonly
@psalm-allow-private-mutation
https://psalm.dev/r/8c55da797e
Changing the promoted property to a standard class property works as expected.
https://psalm.dev/r/da58a808ef
The text was updated successfully, but these errors were encountered:
I found these snippets:
<?php class C { /** @param int $x */ public function __construct( /** @psalm-readonly-allow-private-mutation */ public $x ) {} public function f(int $x): void { $this->x = $x; } } $c = new C(10); $c->f(20);
Psalm output (using commit 997bded): ERROR: InaccessibleProperty - 11:9 - C::$x is marked readonly
<?php class C { /** @psalm-readonly-allow-private-mutation */ public int $x; public function __construct(int $x) { $this->x = $x; } public function f(int $x): void { $this->x = $x; } } $c = new C(10); $c->f(20); $c->x = 30;
Psalm output (using commit 997bded): ERROR: InaccessibleProperty - 18:1 - C::$x is marked readonly
Sorry, something went wrong.
vimeo#7731 - recognize @psalm-allow-private-mutation in PHP 8+ cons…
0abde25
…tructors
Successfully merging a pull request may close this issue.
It looks like the
@readonly
restriction is picked up, but not the@psalm-allow-private-mutation
exception.https://psalm.dev/r/8c55da797e
Changing the promoted property to a standard class property works as expected.
https://psalm.dev/r/da58a808ef
The text was updated successfully, but these errors were encountered: