function LazyProxyTrait::__unset
File
-
vendor/
symfony/ var-exporter/ LazyProxyTrait.php, line 241
Class
Namespace
Symfony\Component\VarExporterCode
public function __unset($name) : void {
$propertyScopes = Hydrator::$propertyScopes[$this::class] ??= Hydrator::getPropertyScopes($this::class);
$scope = null;
$instance = $this;
if ([
$class,
,
$readonlyScope,
] = $propertyScopes[$name] ?? null) {
$scope = Registry::getScope($propertyScopes, $class, $name, $readonlyScope);
if ($readonlyScope === $scope || isset($propertyScopes["\x00{$scope}\x00{$name}"])) {
if ($state = $this->lazyObjectState ?? null) {
$instance = $state->realInstance ??= ($state->initializer)();
}
goto unset_in_scope;
}
}
if ($state = $this->lazyObjectState ?? null) {
$instance = $state->realInstance ??= ($state->initializer)();
}
elseif ((Registry::$parentMethods[self::class] ??= Registry::getParentMethods(self::class))['unset']) {
parent::__unset($name);
return;
}
unset_in_scope:
if (null === $scope) {
unset($instance->{$name});
}
else {
$accessor = Registry::$classAccessors[$scope] ??= Registry::getClassAccessors($scope);
$accessor['unset']($instance, $name);
}
}