JFIF x x C C " } !1AQa "q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w !1AQ aq"2B #3Rbr{
File "InMemoryClassDefinitionRepository.php"
Full Path: /home/palsarh/web/palsarh.in/public_html/vendor/cuyz/valinor/src/Definition/Repository/Cache/InMemoryClassDefinitionRepository.php
File size: 684 bytes
MIME-type: text/x-php
Charset: utf-8
<?php
declare(strict_types=1);
namespace CuyZ\Valinor\Definition\Repository\Cache;
use CuyZ\Valinor\Definition\ClassDefinition;
use CuyZ\Valinor\Definition\Repository\ClassDefinitionRepository;
use CuyZ\Valinor\Type\ObjectType;
/** @internal */
final class InMemoryClassDefinitionRepository implements ClassDefinitionRepository
{
/** @var array<string, ClassDefinition> */
private array $classDefinitions = [];
public function __construct(
private ClassDefinitionRepository $delegate,
) {}
public function for(ObjectType $type): ClassDefinition
{
return $this->classDefinitions[$type->toString()] ??= $this->delegate->for($type);
}
}