Skip to content

Commit 062a2e3

Browse files
committed
Ignore static methods when resolving method from property access
1 parent 44f5ba1 commit 062a2e3

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/Reflection/Nette/NetteObjectClassReflectionExtension.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ public function hasProperty(ClassReflection $classReflection, string $propertyNa
2828
if ($getterMethod === null) {
2929
return false;
3030
}
31+
if ($getterMethod->isStatic()) {
32+
return false;
33+
}
3134

3235
return $getterMethod->isPublic();
3336
}

src/Reflection/Nette/SmartObjectPropertiesClassReflectionExtension.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ public function hasProperty(ClassReflection $classReflection, string $propertyNa
2525
if ($getterMethod === null) {
2626
return false;
2727
}
28+
if ($getterMethod->isStatic()) {
29+
return false;
30+
}
2831

2932
return $getterMethod->isPublic();
3033
}

0 commit comments

Comments
 (0)