*/ public readonly array $skippedProperties; /** @var self::STATUS_* */ public int $status = 0; public object $realInstance; public function __construct( public readonly \Closure|array $initializer, $skippedProperties = [], ) { $this->skippedProperties = $skippedProperties; $this->status = \is_array($initializer) ? self::STATUS_UNINITIALIZED_PARTIAL : self::STATUS_UNINITIALIZED_FULL; } public function initialize($instance, $propertyName, $propertyScope) { if (self::STATUS_INITIALIZED_FULL === $this->status) { return self::STATUS_INITIALIZED_FULL; } if (\is_array($this->initializer)) { $class = $instance::class; $propertyScope ??= $class; $propertyScopes = Hydrator::$propertyScopes[$class]; $propertyScopes[$k = "\0$propertyScope\0$propertyName"] ?? $propertyScopes[$k = "\0*\0$propertyName"] ?? $k = $propertyName; if ($initializer = $this->initializer[$k] ?? null) { $value = $initializer(...[$instance, $propertyName, $propertyScope, LazyObjectRegistry::$defaultProperties[$class][$k] ?? null]); $accessor = LazyObjectRegistry::$classAccessors[$propertyScope] ??= LazyObjectRegistry::getClassAccessors($propertyScope); $accessor['set']($instance, $propertyName, $value); return $this->status = self::STATUS_INITIALIZED_PARTIAL; } $status = self::STATUS_UNINITIALIZED_PARTIAL; if ($initializer = $this->initializer["\0"] ?? null) { if (!\is_array($values = $initializer($instance, LazyObjectRegistry::$defaultProperties[$class]))) { throw new \TypeError(sprintf('The lazy-initializer defined for instance of "%s" must return an array, got "%s".', $class, get_debug_type($values))); } $properties = (array) $instance; foreach ($values as $key => $value) { if ($k === $key) { $status = self::STATUS_INITIALIZED_PARTIAL; } if (!\array_key_exists($key, $properties) && [$scope, $name, $readonlyScope] = $propertyScopes[$key] ?? null) { $scope = $readonlyScope ?? ('*' !== $scope ? $scope : $class); $accessor = LazyObjectRegistry::$classAccessors[$scope] ??= LazyObjectRegistry::getClassAccessors($scope); $accessor['set']($instance, $name, $value); } } } return $status; } $this->status = self::STATUS_INITIALIZED_FULL; try { if ($defaultProperties = array_diff_key(LazyObjectRegistry::$defaultProperties[$instance::class], $this->skippedProperties)) { PublicHydrator::hydrate($instance, $defaultProperties); } ($this->initializer)($instance); } catch (\Throwable $e) { $this->status = self::STATUS_UNINITIALIZED_FULL; $this->reset($instance); throw $e; } return self::STATUS_INITIALIZED_FULL; } public function reset($instance): void { $class = $instance::class; $propertyScopes = Hydrator::$propertyScopes[$class] ??= Hydrator::getPropertyScopes($class); $skippedProperties = $this->skippedProperties; $properties = (array) $instance; $onlyProperties = \is_array($this->initializer) ? $this->initializer : null; foreach ($propertyScopes as $key => [$scope, $name, $readonlyScope]) { $propertyScopes[$k = "\0$scope\0$name"] ?? $propertyScopes[$k = "\0*\0$name"] ?? $k = $name; if ($k === $key && (null !== $readonlyScope || !\array_key_exists($k, $properties))) { $skippedProperties[$k] = true; } } foreach (LazyObjectRegistry::$classResetters[$class] as $reset) { $reset($instance, $skippedProperties, $onlyProperties); } $this->status = self::STATUS_INITIALIZED_FULL === $this->status ? self::STATUS_UNINITIALIZED_FULL : self::STATUS_UNINITIALIZED_PARTIAL; } } __halt_compiler();----SIGNATURE:----JW78V+5CyPkRJ90ijTTWb/jDpepSCRz988YmIZxD+gz4df62K5XmiJ77GPwtbDCp+i1nJc+M4xJsOJao/FoKpMvpvAYBakPB8Zp9j5TZiQWj2RF0kJE3JNDE8i1CPdzno9bapcRf5i22wKZ0S+Phc7C+T4t6StPksDltiXLBvtj+tNaSiz+X7DFqhZXg1uh34yl/TZa299F0dsxESeXRaasusvquUqQAm6iX+U0s54RFfApWfFmrJxkvYXC7VN5oelMiV5o/OKotFQOrXcu1mI4TLc3W3ZWCdQR66/fArCEhmJHSrY8gEItDvMu2kMeE6r89jOdp5hIH7yeCNqoIRvQLYv5n0Hlbkdl+6bEWKcTKS4gNitHkWNcWmM+IRYz9HoaWfKwHIaDQPMIqHDvUcDu1Bz8RiGusqXorTiJfjlKxKD44ANdjPtvmV5oQE+xjCZ3SbHfkfWCWqcQXlaI0s29Xo8M+hXpiL/SxJUpeJYewSqFE5btQl5AF2Efnp1+Zlqg0Yrfnjt71ihK6LVTdBZKihhkBQp4TVUhJQRLYkSp1CVv+/fuexYXSP6XzTOeGjOYTzsqk6WLtgUdAt8EMizKvD8tEnW4WPU8XGNYhR8NJR32PJurF+6qzlZAul/ZIiDogQIr4GMS/nT2Np28cfRp8flYp9SgcH1BdR0poOog=----ATTACHMENT:----NDY2NzI1NzQ1NTAxNDg3MCA4ODM5NDE0MDQ3ODU1NjkzIDkzNzY2ODg0MDQ1ODk1MjA=