Immutability inheritance already works with class annotations in parent classes. Property annotations are not considered yet.
All non-private properties in parent classes should be considered during immutability check. Example:
class ParentClass
{
/** @immutable */
protected $bar;
}
class ChildClass extends ParentClass
{
public function set()
{
$this->bar = true; // should throw error, because $bar is immutable
}
}
Immutability inheritance already works with class annotations in parent classes. Property annotations are not considered yet.
All non-private properties in parent classes should be considered during immutability check. Example: