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
Fixphpstan/phpstan#13853: skip readOnlyAssignNotInConstructor when isset guard is present
- Track PropertyInitializationExpr with NeverType in the falsy branch of isset($this->prop) in TypeSpecifier
- Skip readOnlyAssignNotInConstructor error in ReadOnlyPropertyAssignRule when PropertyInitializationExpr indicates property is known uninitialized
- Adjust IssetCheck and ClassPropertiesNode to treat NeverType PropertyInitializationExpr as "not initialized"
- New regression test in tests/PHPStan/Rules/Properties/data/bug-13853.php
$errors[] = RuleErrorBuilder::message(sprintf('Readonly property %s::$%s is assigned outside of the constructor.', $declaringClass->getDisplayName(), $propertyReflection->getName()))
0 commit comments