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