final class TypeRules
    implements TypeRules
Restricted visibility: declared "@visibility SqlSemantics". Code outside that scope must not name this declaration.

MySql TypeRules implementation.

Methods§

public function __construct(private Dialect $dialect)

Retains the language identity used in semantic output.

Parameters

$dialectDialect
public function read(Node $node, ?Node $table = null): TypeDescriptor

Reads a declared type, including table-dependent storage rules and modifiers.

Parameters

$nodeNode
$table?Node
Calls 5
public function canonical(string $name): ?string

Resolves the built-in aliases modeled for this dialect.

Parameters

$namestring

Returns

?string
Test cases 1
Called from 1
Calls 1
public function affinity(string $name): string

Computes storage affinity from a declaration name.

Parameters

$namestring

Returns

string
Test cases 1
Calls 1
public function typeName(Token $token): ?string

Classifies a literal's lexical category without converting its contents.

Parameters

$tokenToken

Returns

?string
Test cases 1
Calls 7
public function integer(string $text): string

Chooses a MySql integer width from its decimal spelling.

Parameters

$textstring

Returns

string
Test cases 1
Called from 2
Calls 1
public function common(list<Expression> $expressions, Node|Token $source): TypeDescriptor

Parameters

$expressionslist<Expression>
$sourceNode|Token
Test cases 1
Calls 9
public function boolean(): TypeDescriptor

Returns the dialect result type of a predicate.

Test cases 2
Calls 1
public function arithmetic(
    string $operator,
    non-empty-list<Expression> $operands,
    Node $source,
): TypeDescriptor

Resolves supported numeric operations, including signed literal boundaries.

Parameters

$operatorstring
$operandsnon-empty-list<Expression>
$sourceNode
Test cases 1
Calls 6
public function predicate(Expression $expression): void

Accepts scalar truth values.

Parameters

$expressionExpression
Test cases 1
public function coalesce(list<Expression> $operands, TypeDescriptor $type): list<Expression>

Parameters

$operandslist<Expression>
$typeTypeDescriptor

Returns

Test cases 1
public function project(Expression $expression): Expression

Resolves the output type of a projected literal.

Parameters

$expressionExpression

Returns

Test cases 1

Private surface 1§

Implementation details, listed for orientation only.

private Dialect $dialect

Test cases 70§

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

Dedicated tests 11
Other tests reaching this symbol 59

Relations§

Instantiated in 1