1
0
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:
Matthew Brown 2018-05-08 22:13:26 -04:00
parent 2c0dd36035
commit bfa21e1108
2 changed files with 23 additions and 0 deletions

View File

@ -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;
}
}

View File

@ -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");
}
}',
],
];
}