Файл: vendor/symfony/var-exporter/Internal/LazyObjectRegistry.php
Строк: 167
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace SymfonyComponentVarExporterInternal;
/**
* Stores the state of lazy objects and caches related reflection information.
*
* As a micro-optimization, this class uses no type declarations.
*
* @internal
*/
class LazyObjectRegistry
{
/**
* @var array<class-string, ReflectionClass>
*/
public static array $classReflectors = [];
/**
* @var array<class-string, array<string, mixed>>
*/
public static array $defaultProperties = [];
/**
* @var array<class-string, list<Closure>>
*/
public static array $classResetters = [];
/**
* @var array<class-string, array{get: Closure, set: Closure, isset: Closure, unset: Closure}>
*/
public static array $classAccessors = [];
/**
* @var array<class-string, array{set: bool, isset: bool, unset: bool, clone: bool, serialize: bool, unserialize: bool, sleep: bool, wakeup: bool, destruct: bool, get: int}>
*/
public static array $parentMethods = [];
public static ?Closure $noInitializerState = null;
public static function getClassResetters($class)
{
$classProperties = [];
if ((self::$classReflectors[$class] ??= new ReflectionClass($class))->isInternal()) {
$propertyScopes = [];
} else {
$propertyScopes = Hydrator::$propertyScopes[$class] ??= Hydrator::getPropertyScopes($class);
}
foreach ($propertyScopes as $key => [$scope, $name, $readonlyScope]) {
$propertyScopes[$k = " $scope