@@ -484,8 +484,11 @@ public function hasProperty(string $propertyName): bool
484484 }
485485
486486 // For BC purpose
487- if ($ this ->getPhpExtension ()->hasStaticProperty ($ this , $ propertyName )) {
488- return $ this ->hasPropertyCache [$ propertyName ] = true ;
487+ if ($ this ->getPhpExtension ()->hasProperty ($ this , $ propertyName )) {
488+ $ property = $ this ->getPhpExtension ()->getProperty ($ this , $ propertyName );
489+ if ($ property ->isStatic ()) {
490+ return $ this ->hasPropertyCache [$ propertyName ] = true ;
491+ }
489492 }
490493
491494 if ($ this ->requireExtendsPropertiesClassReflectionExtension ->hasProperty ($ this , $ propertyName )) {
@@ -527,8 +530,11 @@ public function hasStaticProperty(string $propertyName): bool
527530 return $ this ->hasStaticPropertyCache [$ propertyName ];
528531 }
529532
530- if ($ this ->getPhpExtension ()->hasStaticProperty ($ this , $ propertyName )) {
531- return $ this ->hasStaticPropertyCache [$ propertyName ] = true ;
533+ if ($ this ->getPhpExtension ()->hasProperty ($ this , $ propertyName )) {
534+ $ property = $ this ->getPhpExtension ()->getProperty ($ this , $ propertyName );
535+ if ($ property ->isStatic ()) {
536+ return $ this ->hasStaticPropertyCache [$ propertyName ] = true ;
537+ }
532538 }
533539
534540 if ($ this ->requireExtendsPropertiesClassReflectionExtension ->hasStaticProperty ($ this , $ propertyName )) {
@@ -737,12 +743,14 @@ public function getProperty(string $propertyName, ClassMemberAccessAnswerer $sco
737743 }
738744
739745 // For BC purpose
740- if ($ this ->getPhpExtension ()->hasStaticProperty ($ this , $ propertyName )) {
741- $ property = $ this ->wrapExtendedProperty ($ propertyName , $ this ->getPhpExtension ()->getStaticProperty ($ this , $ propertyName ));
742- if ($ scope ->canReadProperty ($ property )) {
743- return $ this ->properties [$ key ] = $ property ;
746+ if ($ this ->getPhpExtension ()->hasProperty ($ this , $ propertyName )) {
747+ $ property = $ this ->wrapExtendedProperty ($ propertyName , $ this ->getPhpExtension ()->getProperty ($ this , $ propertyName ));
748+ if ($ property ->isStatic ()) {
749+ if ($ scope ->canReadProperty ($ property )) {
750+ return $ this ->properties [$ key ] = $ property ;
751+ }
752+ $ this ->properties [$ key ] = $ property ;
744753 }
745- $ this ->properties [$ key ] = $ property ;
746754 }
747755
748756 if (!isset ($ this ->properties [$ key ])) {
@@ -780,7 +788,12 @@ public function getInstanceProperty(string $propertyName, ClassMemberAccessAnswe
780788 continue ;
781789 }
782790
783- $ property = $ this ->wrapExtendedProperty ($ propertyName , $ extension ->getProperty ($ this , $ propertyName ));
791+ $ nakedProperty = $ extension ->getProperty ($ this , $ propertyName );
792+ if ($ nakedProperty ->isStatic ()) {
793+ continue ;
794+ }
795+
796+ $ property = $ this ->wrapExtendedProperty ($ propertyName , $ nakedProperty );
784797 if ($ scope ->canReadProperty ($ property )) {
785798 return $ this ->instanceProperties [$ key ] = $ property ;
786799 }
@@ -809,9 +822,14 @@ public function getStaticProperty(string $propertyName): ExtendedPropertyReflect
809822 return $ this ->staticProperties [$ key ];
810823 }
811824
812- if ($ this ->getPhpExtension ()->hasStaticProperty ($ this , $ propertyName )) {
813- $ property = $ this ->wrapExtendedProperty ($ propertyName , $ this ->getPhpExtension ()->getStaticProperty ($ this , $ propertyName ));
814- return $ this ->staticProperties [$ key ] = $ property ;
825+ if ($ this ->getPhpExtension ()->hasProperty ($ this , $ propertyName )) {
826+ $ nakedProperty = $ this ->getPhpExtension ()->getProperty ($ this , $ propertyName );
827+ if ($ nakedProperty ->isStatic ()) {
828+ $ property = $ this ->wrapExtendedProperty ($ propertyName , $ nakedProperty );
829+ if ($ property ->isStatic ()) {
830+ return $ this ->staticProperties [$ key ] = $ property ;
831+ }
832+ }
815833 }
816834
817835 if ($ this ->requireExtendsPropertiesClassReflectionExtension ->hasStaticProperty ($ this , $ propertyName )) {
@@ -824,7 +842,7 @@ public function getStaticProperty(string $propertyName): ExtendedPropertyReflect
824842
825843 public function hasNativeProperty (string $ propertyName ): bool
826844 {
827- return $ this ->getPhpExtension ()->hasNativeProperty ($ this , $ propertyName );
845+ return $ this ->getPhpExtension ()->hasProperty ($ this , $ propertyName );
828846 }
829847
830848 public function getNativeProperty (string $ propertyName ): PhpPropertyReflection
0 commit comments