enumNumberForm
enum NumberForm
Public API: explicitly declared with
@visibility public.The three kinds of number literal the MySQL lexer tells apart.
Digits alone are an integer while they fit an unsigned 64-bit integer and a decimal beyond that; digits with a decimal point are a decimal; a number with an exponent is a floating-point number. Source: https://dev.mysql.com/doc/refman/8.4/en/number-literals.html.
[\SqlSemantics\Platform\MySql\Statement\Literal\NumberForm::of('18446744073709551616'), \SqlSemantics\Platform\MySql\Statement\Literal\NumberForm::of('1e3')] // => [\SqlSemantics\Platform\MySql\Statement\Literal\NumberForm::Decimal, \SqlSemantics\Platform\MySql\Statement\Literal\NumberForm::Float]Cases§
case Integercase Decimalcase FloatMethods§
public static function of(string $text): ?selfClassifies the text of an unsigned number as the lexer does, or answers null when it is no number.
Parameters
$text | string |
Returns
?selfTest cases 5
NumberFormTest::testOfAnswersNullForTextThatIsNoUnsignedNumbercallsNumberFormTest::testOfClassifiesADecimalPointAsADecimalcallsNumberFormTest::testOfClassifiesAnExponentAsAFloatcallsNumberFormTest::testOfClassifiesDigitsAsAnIntegerUpToTheUnsignedLimitcallsNumberFormTest::testOfClassifiesDigitsBeyondTheUnsignedLimitAsADecimalcalls
Called from 1
Calls 7
- function-call
preg_matchline 30 - class-const NumberForm::Float() line 31
- class-const NumberForm::Decimal() line 34
- function-call
ltrimline 39 - function-call
strlenline 41 - function-call
strcmpline 41 - class-const NumberForm::Integer() line 41
Test cases 8§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 6
NumberFormTest::testCasesNameTheThreeFormscallsNumberFormTest::testOfAnswersNullForTextThatIsNoUnsignedNumbercallsNumberFormTest::testOfClassifiesADecimalPointAsADecimalcallsNumberFormTest::testOfClassifiesAnExponentAsAFloatcallsNumberFormTest::testOfClassifiesDigitsAsAnIntegerUpToTheUnsignedLimitcallsNumberFormTest::testOfClassifiesDigitsBeyondTheUnsignedLimitAsADecimalcalls
Other tests reaching this symbol 2
Relations§
Static calls 1
Constant reads 11
- class-const SqlSemantics\Platform\MySql\Lowering\Query\Shared\ClauseRule::positions() packages/sql-semantics-mysql/src/Lowering/Query/Shared/ClauseRule.php:234
- class-const SqlSemantics\Platform\MySql\Rules\Query\ItemNaming::own() packages/sql-semantics-mysql/src/Rules/Query/ItemNaming.php:142
- class-const SqlSemantics\Platform\MySql\Rules\Query\ItemNaming::constant() packages/sql-semantics-mysql/src/Rules/Query/ItemNaming.php:159
- class-const SqlSemantics\Platform\MySql\Rules\Query\SortScopes::check() packages/sql-semantics-mysql/src/Rules/Query/SortScopes.php:52
- class-const SqlSemantics\Platform\MySql\Statement\Literal\NumberLiteral::beyondSigned() packages/sql-semantics-mysql/src/Statement/Literal/NumberLiteral.php:68
- class-const SqlSemantics\Platform\MySql\Statement\Literal\NumberLiteral::type() packages/sql-semantics-mysql/src/Statement/Literal/NumberLiteral.php:77
- class-const SqlSemantics\Platform\MySql\Statement\Literal\NumberLiteral::type() packages/sql-semantics-mysql/src/Statement/Literal/NumberLiteral.php:78
- class-const SqlSemantics\Platform\MySql\Statement\Literal\NumberLiteral::type() packages/sql-semantics-mysql/src/Statement/Literal/NumberLiteral.php:79
- class-const SqlSemantics\Platform\MySql\Statement\Query\Clause\OutputOrdinal::__construct() packages/sql-semantics-mysql/src/Statement/Query/Clause/OutputOrdinal.php:52
- class-const SqlSemantics\Platform\MySql\Statement\Query\Clause\ProcedureAnalyse::__construct() packages/sql-semantics-mysql/src/Statement/Query/Clause/ProcedureAnalyse.php:46
- class-const SqlSemantics\Platform\MySql\Statement\Query\Clause\RowLimit::__construct() packages/sql-semantics-mysql/src/Statement/Query/Clause/RowLimit.php:45