We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Simple example:
<?php class HelloWorld { public private(set) \DateTimeImmutable $createdAt { get { return $this->createdAt ??= new \DateTimeImmutable(); } } }
Actual sandbox false-positive:
Class HelloWorld has an uninitialized property $createdAt. Give it default value or assign it in the constructor.
Actual PHPStan 2.1.3 false-positive:
Property HelloWorld::$createdAt is not writable
Actual PHPStan, in principle, considers any properties where setters are absent to be read-only, although this is not the case.
https://phpstan.org/r/70b0264c-11e8-4c22-94ad-f6cfaff44092
No response
Bug report
Simple example:
Actual sandbox false-positive:
Class HelloWorld has an uninitialized property $createdAt. Give it default value or assign it in the constructor.Actual PHPStan 2.1.3 false-positive:
Property HelloWorld::$createdAt is not writableActual PHPStan, in principle, considers any properties where setters are absent to be read-only, although this is not the case.
Code snippet that reproduces the problem
https://phpstan.org/r/70b0264c-11e8-4c22-94ad-f6cfaff44092
Expected output
Did PHPStan help you today? Did it make you happy in any way?
No response