function LazyObjectRegistry::getScope
8 calls to LazyObjectRegistry::getScope()
- LazyGhostTrait::__get in vendor/
symfony/ var-exporter/ LazyGhostTrait.php - LazyGhostTrait::__isset in vendor/
symfony/ var-exporter/ LazyGhostTrait.php - LazyGhostTrait::__set in vendor/
symfony/ var-exporter/ LazyGhostTrait.php - LazyGhostTrait::__unset in vendor/
symfony/ var-exporter/ LazyGhostTrait.php - LazyProxyTrait::__get in vendor/
symfony/ var-exporter/ LazyProxyTrait.php
File
-
vendor/
symfony/ var-exporter/ Internal/ LazyObjectRegistry.php, line 122
Class
- LazyObjectRegistry
- Stores the state of lazy objects and caches related reflection information.
Namespace
Symfony\Component\VarExporter\InternalCode
public static function getScope($propertyScopes, $class, $property, $readonlyScope = null) {
if (null === $readonlyScope && !isset($propertyScopes[$k = "\x00{$class}\x00{$property}"]) && !isset($propertyScopes[$k = "\x00*\x00{$property}"])) {
return null;
}
$frame = debug_backtrace(\DEBUG_BACKTRACE_PROVIDE_OBJECT | \DEBUG_BACKTRACE_IGNORE_ARGS, 3)[2];
if (\ReflectionProperty::class === ($scope = $frame['class'] ?? \Closure::class)) {
$scope = $frame['object']->class;
}
if (null === $readonlyScope && '*' === $k[1] && ($class === $scope || is_subclass_of($class, $scope) && !isset($propertyScopes["\x00{$scope}\x00{$property}"]))) {
return null;
}
return $scope;
}