classTypeRules
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
$dialect | Dialect |
public function read(Node $node, ?Node $table = null): TypeDescriptorReads a declared type, including table-dependent storage rules and modifiers.
Returns
Calls 5
- method-call Node::tokens() line 36
- function-call
implodeline 53 - method-call TypeRules::canonical() line 54
- function-call
strtoupperline 54 - new TypeDescriptor line 55
public function canonical(string $name): ?stringResolves the built-in aliases modeled for this dialect.
Parameters
$name | string |
Returns
?stringTest cases 1
Called from 1
Calls 1
- function-call
strtolowerline 74
public function affinity(string $name): stringComputes storage affinity from a declaration name.
Parameters
$name | string |
Returns
stringTest cases 1
Calls 1
- function-call
str_containsline 86
public function typeName(Token $token): ?stringClassifies a literal's lexical category without converting its contents.
Parameters
$token | Token |
Returns
?stringTest cases 1
Calls 7
- function-call
str_replaceline 107 - function-call
in_arrayline 108 - function-call
preg_matchline 108 - static-call Tree::unsupported() line 109
- function-call
strtoupperline 111 - method-call TypeRules::integer() line 113
- function-call
ctype_digitline 116
public function integer(string $text): stringChooses a MySql integer width from its decimal spelling.
Parameters
$text | string |
Returns
stringTest cases 1
Called from 2
Calls 1
- function-call
ltrimline 131
public function common(list<Expression> $expressions, Node|Token $source): TypeDescriptorpublic function boolean(): TypeDescriptorReturns the dialect result type of a predicate.
Returns
Test cases 2
Calls 1
public function arithmetic(
string $operator,
non-empty-list<Expression> $operands,
Node $source,
): TypeDescriptorResolves supported numeric operations, including signed literal boundaries.
Parameters
$operator | string | |
$operands | non-empty-list<Expression> | |
$source | Node |
Returns
Test cases 1
Calls 6
- method-call TypeResolution::common() line 185
- new TypeResolution line 185
- function-call
in_arrayline 186 - function-call
strtolowerline 186 - static-call Tree::unsupported() line 187
- new TypeDescriptor line 189
public function predicate(Expression $expression): voidpublic function coalesce(list<Expression> $operands, TypeDescriptor $type): list<Expression>public function project(Expression $expression): ExpressionResolves the output type of a projected literal.
Parameters
$expression | Expression |
Returns
Test cases 1
Private surface 1§
Implementation details, listed for orientation only.
private Dialect $dialectTest cases 70§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 11
TypeRulesTestcallsTypeRulesTest::testAffinityUsesDeclaredTypePrecedencecallsTypeRulesTest::testArithmeticRetainsLanguageSemanticscallsTypeRulesTest::testBooleanNamesPredicateResultcallsTypeRulesTest::testCanonicalResolvesIntegercallsTypeRulesTest::testCoalescePreservesOperandscallsTypeRulesTest::testCommonPreservesHomogeneousTypecallsTypeRulesTest::testIntegerModelsLargeMagnitudecallsTypeRulesTest::testPredicateAcceptsBooleanResultscallsTypeRulesTest::testProjectPreservesTypedValuescallsTypeRulesTest::testTypeNameClassifiesIntegerTokencalls
Other tests reaching this symbol 59
SchemaAnalyzerTestcallsColumnPropertiesTestcallsColumnReaderTestcallsConstraintReaderTestcallsDialectParserTestcallsIdentifiersTestcallsSchemaChangesTestcallsSchemaReaderTestcallsStatementListTestcallsTokenGroupsTestcallsTreeTestcallsTypeReaderTestcallsBinderTestcallsBoundRelationTestcallsExpressionBinderTestcallsExpressionRulesTestcallsFromBinderTestcallsIdentitySequenceTestcallsLiteralBinderTestcallsNullFactsTestcallsProjectionBinderTestcallsScopeTestcallsSelectBinderTestcallsSelectModifiersBinderTestcallsSyntaxGuardTestcallsTableResolverTestcallsTypeResolutionTestcallsDialectTestcallsBoundSelectTestcallsColumnBindingTestcallsExpressionKindTestcallsExpressionTestcallsJoinKindTestcallsJoinTestcallsOrderingTestcallsOutputColumnTestcallsTableUseTestcallsPlatformTestcallsNameRulesTestcallsQueryRulesTestcallsSchemaRulesTestcallsSyntaxRulesTestcallsColumnDefinitionTestcallsColumnGenerationTestcallsConstraintKindTestcallsGenerationKindTestcallsInvariantTestcallsTableConstraintTestcallsTableDefinitionTestcallsSchemaBuilderTestcallsSchemaTestcallsSemanticExceptionTestcallsNullabilityTestcallsTypeDescriptorTestcallsSchemaTestcallsNameRulesTestcallsPlatformTestcallsQueryRulesTestcallsSchemaRulesTestcalls