final class NormalizationTest
    implements Scalar
    uses Snapshot
Public API: explicitly declared with @visibility public.

A test of whether a string is in a Unicode normal form: a IS [NOT] [NFC|NFD|NFKC|NFKD] NORMALIZED.

The parser reads it as a call of pg_catalog.is_normalized(a, form); the form defaults to NFC.

Rule: PG-NORMALIZATION-TEST-001. Facts: boolean for a text operand (or a string constant read as text), NULL when the operand can be; any other operand type is reported. The operand must keep its place before IS (PG-PRECEDENCE-001). Source: https://www.postgresql.org/docs/17/functions-string.html#FUNCTIONS-STRING-SQL. Status: Implemented.

Reading the normal form of a testdoctest
$query = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze("SELECT 'a' IS NOT NFKC NORMALIZED");
    [$query->field(0)->expression->form, $query->toString()] // => [\SqlSemantics\Platform\PostgreSql\Statement\Option\NormalForm::Nfkc, "SELECT 'a' IS NOT NFKC NORMALIZED"]

Properties§

public Scalar $operand
public bool $negated
public NormalForm|null $form = null

Methods§

public function __construct(
    public Scalar $operand,
    public bool $negated,
    public NormalForm|null $form = null,
)

Parameters

$operandScalarThe tested string
$negatedboolWhether NOT is written
$formNormalForm|nullThe normal form, or null when none is written
Calls 4
public function deriveScalar(Derivation $derivation, Environment $environment): ScalarFact

Derives the operand and checks that it is text.

Parameters

$derivationDerivation
$environmentEnvironment

Returns

Calls 9
public function render(Output $out): void

Writes the value and the test.

Parameters

$outOutput
Test cases 1
Calls 2

Test cases 3§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 3

Relations§

Instantiated in 4
Type checks 1