mirror of
https://github.com/danog/psalm.git
synced 2025-01-21 21:31:13 +01:00
Fix #721 by allowing @property annotations to be inheritable
This commit is contained in:
parent
2c0dd36035
commit
bfa21e1108
@ -256,6 +256,9 @@ class Populator
|
||||
|
||||
$storage->public_class_constants += $parent_storage->public_class_constants;
|
||||
$storage->protected_class_constants += $parent_storage->protected_class_constants;
|
||||
|
||||
$storage->pseudo_property_get_types += $parent_storage->pseudo_property_get_types;
|
||||
$storage->pseudo_property_set_types += $parent_storage->pseudo_property_set_types;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -223,6 +223,26 @@ class MagicPropertyTest extends TestCase
|
||||
}
|
||||
}',
|
||||
],
|
||||
'inheritedGetPropertyExplicitCall' => [
|
||||
'<?php
|
||||
/**
|
||||
* @property string $test
|
||||
*/
|
||||
class A {
|
||||
public function __get(string $name) {}
|
||||
|
||||
/**
|
||||
* @param mixed $value
|
||||
*/
|
||||
public function __set(string $name, $value) {}
|
||||
}
|
||||
|
||||
class B extends A {
|
||||
public function test(): string {
|
||||
return $this->__get("test");
|
||||
}
|
||||
}',
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user