packages/ztd-query-core/src/Shadow/Mutation/Upsert/UpsertLiteral.php

1<?php
2
3declare(strict_types=1);
4
5namespace ZtdQuery\Shadow\Mutation\Upsert;
6
7/**
8 * Retains the type and identity of one expression literal.
9 *
10 * @template TValue
11 */
12final class UpsertLiteral implements UpsertLiteralSource
13{
14    /**
15     * @param TValue $value Literal supplied by the caller.
16     */
17    public function __construct(private readonly mixed $value)
18    {
19    }
20
21    /**
22     * @return TValue The unchanged literal.
23     */
24    public function value(): mixed
25    {
26        return $this->value;
27    }
28}
29