<?php // Generated by CuyZ\Valinor\Cache\FileSystemCache
return fn (array $transformers, CuyZ\Valinor\Normalizer\Transformer\Transformer $delegate) => new class ($transformers, $delegate) implements CuyZ\Valinor\Normalizer\Transformer\Transformer {
    private array $transformers;

    private CuyZ\Valinor\Normalizer\Transformer\Transformer $delegate;

    public function __construct(array $transformers, CuyZ\Valinor\Normalizer\Transformer\Transformer $delegate)
    {
        $this->transformers = $transformers;
        $this->delegate = $delegate;
    }

    public function transform(mixed $value): mixed
    {
        $references = new WeakMap();
        return $this->transform_object_cuyz_valinor_tests_integration_normalizer_classwithdatetimeinterface_697272ac658921dbf7da725eb7ffc5c3($value, $references);
    }

    private function transform_object_cuyz_valinor_tests_integration_normalizer_classwithdatetimeinterface_697272ac658921dbf7da725eb7ffc5c3(CuyZ\Valinor\Tests\Integration\Normalizer\ClassWithDateTimeInterface $value, WeakMap $references): array
    {
        if (isset($references[$value])) {
            throw new CuyZ\Valinor\Normalizer\Exception\CircularReferenceFoundDuringNormalization($value);
        }
        $references = clone $references;
        $references[$value] = $value;
        $values = [
            'date' => $value->date,
        ];
        $transformed = [];
        $transformed['date'] = $this->transform_datetimeinterface_a4abe018d9ab64b110de5c69af50f66fb895f352($values['date'], $references);
        return $transformed;
    }

    private function transform_datetimeinterface_a4abe018d9ab64b110de5c69af50f66fb895f352(mixed $value, WeakMap $references): mixed
    {
        $next = fn () => $value->format('Y-m-d\\TH:i:s.uP');
        if ($value instanceof DateTimeInterface) {
            $next = fn () => $this->transformers[0]($value, $next);
        }
        return $next();
    }
};
