You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We're currently introducing PHPStan's bleeding edge and I see that it started reporting errors like @readonly property cannot have a default value on classes that extend MyCLabs\Enum\Enum. It looks like @psalm-immutable annotation is normalised by PHPStan into readonly state, so cache and instances properties are considered as impure.
Is it possible to improve Enum's phpDocs so PHPStan won't report this errors?
while there is no uninitialized state for non-typed properties and they are implicitly null by default, cache and instances clearly have a different default value
That's why PHPStan reports it. Simplest fix here is to have implicit null as a default value instead of empty array.
We're currently introducing PHPStan's bleeding edge and I see that it started reporting errors like
@readonly property cannot have a default value
on classes that extendMyCLabs\Enum\Enum
. It looks like@psalm-immutable
annotation is normalised by PHPStan intoreadonly
state, socache
andinstances
properties are considered as impure.Is it possible to improve
Enum
's phpDocs so PHPStan won't report this errors?Thanks @mabar for pointing it out on Slack 🍻
The text was updated successfully, but these errors were encountered: