| 1: | <?php declare(strict_types = 1); |
| 2: | |
| 3: | namespace PHPStan\Analyser; |
| 4: | |
| 5: | use PHPStan\Reflection\ClassMemberAccessAnswerer; |
| 6: | use PHPStan\Reflection\ClassReflection; |
| 7: | use PHPStan\Reflection\ConstantReflection; |
| 8: | use PHPStan\Reflection\MethodReflection; |
| 9: | use PHPStan\Reflection\PropertyReflection; |
| 10: | |
| 11: | final class OutOfClassScope implements ClassMemberAccessAnswerer |
| 12: | { |
| 13: | |
| 14: | |
| 15: | public function __construct() |
| 16: | { |
| 17: | } |
| 18: | |
| 19: | public function isInClass(): bool |
| 20: | { |
| 21: | return false; |
| 22: | } |
| 23: | |
| 24: | public function getClassReflection(): ?ClassReflection |
| 25: | { |
| 26: | return null; |
| 27: | } |
| 28: | |
| 29: | public function canAccessProperty(PropertyReflection $propertyReflection): bool |
| 30: | { |
| 31: | return $propertyReflection->isPublic(); |
| 32: | } |
| 33: | |
| 34: | public function canCallMethod(MethodReflection $methodReflection): bool |
| 35: | { |
| 36: | return $methodReflection->isPublic(); |
| 37: | } |
| 38: | |
| 39: | public function canAccessConstant(ConstantReflection $constantReflection): bool |
| 40: | { |
| 41: | return $constantReflection->isPublic(); |
| 42: | } |
| 43: | |
| 44: | } |
| 45: | |