Skip to content

Commit 38eaf5b

Browse files
assert6limingxinleo
authored andcommitted
fix ignore parent private properties
1 parent 408d961 commit 38eaf5b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Aop/PropertyHandlerTrait.php

+3
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ protected function __handlePropertyHandler(string $className)
4242
$parentReflectionClass = $reflectionClass;
4343
while ($parentReflectionClass = $parentReflectionClass->getParentClass()) {
4444
$parentClassProperties = ReflectionManager::reflectPropertyNames($parentReflectionClass->getName());
45+
$parentClassProperties = array_filter($parentClassProperties, static function($property) use ($reflectionClass){
46+
return $reflectionClass->hasProperty($property);
47+
});
4548
$parentClassProperties = array_diff($parentClassProperties, $handled);
4649
$handled = array_merge(
4750
$handled,

0 commit comments

Comments
 (0)