Skip to content

Commit 28f97da

Browse files
Review
1 parent ae4eb45 commit 28f97da

File tree

1 file changed

+4
-16
lines changed

1 file changed

+4
-16
lines changed

src/Reflection/ClassReflection.php

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -813,35 +813,23 @@ public function getInstanceProperty(string $propertyName, ClassMemberAccessAnswe
813813
return $this->instanceProperties[$key];
814814
}
815815

816-
public function getStaticProperty(string $propertyName, ClassMemberAccessAnswerer $scope): ExtendedPropertyReflection
816+
public function getStaticProperty(string $propertyName): ExtendedPropertyReflection
817817
{
818818
$key = $propertyName;
819-
if ($scope->isInClass()) {
820-
$key = sprintf('%s-%s', $key, $scope->getClassReflection()->getCacheKey());
821-
}
822819

823820
if (!isset($this->staticProperties[$key])) {
824821
if ($this->getPhpExtension()->hasStaticProperty($this, $propertyName)) {
825822
$property = $this->wrapExtendedProperty($this->getPhpExtension()->getStaticProperty($this, $propertyName));
826-
if ($scope->canReadProperty($property)) {
827-
return $this->staticProperties[$key] = $property;
828-
}
829-
$this->staticProperties[$key] = $property;
823+
return $this->staticProperties[$key] = $property;
830824
}
831-
}
832825

833-
if (!isset($this->staticProperties[$key])) {
834826
if ($this->requireExtendsPropertiesClassReflectionExtension->hasStaticProperty($this, $propertyName)) {
835827
$property = $this->requireExtendsPropertiesClassReflectionExtension->getStaticProperty($this, $propertyName);
836-
$this->staticProperties[$key] = $property;
828+
return $this->staticProperties[$key] = $property;
837829
}
838830
}
839831

840-
if (!isset($this->staticProperties[$key])) {
841-
throw new MissingPropertyFromReflectionException($this->getName(), $propertyName);
842-
}
843-
844-
return $this->staticProperties[$key];
832+
throw new MissingPropertyFromReflectionException($this->getName(), $propertyName);
845833
}
846834

847835
public function hasNativeProperty(string $propertyName): bool

0 commit comments

Comments
 (0)