enumEscapeRule
enum EscapeRule
Public API: explicitly declared with
@visibility public.How a backslash inside a quoted string is read: as an escape character or as itself.
The session mode NO_BACKSLASH_ESCAPES decides it, and the language profile fixes that mode. A string value holds the rule it is spelled under, because the same bytes are spelled differently under each rule; a value built for the other rule than the profile of its operation is refused when the operation is constructed. Source: https://dev.mysql.com/doc/refman/8.4/en/sql-mode.html#sqlmode_no_backslash_escapes.
\SqlSemantics\Platform\MySql\Statement\Literal\EscapeRule::under(new \SqlSemantics\Platform\MySql\Model\Contract\LexicalSettings('NO_BACKSLASH_ESCAPES')) // => \SqlSemantics\Platform\MySql\Statement\Literal\EscapeRule::VerbatimCases§
case Backslashcase VerbatimMethods§
public static function under(LexicalSettings $lexical): selfAnswers the rule the lexical settings of a profile select.
Parameters
$lexical | LexicalSettings |
Returns
selfTest cases 2
Called from 3
- static-call SqlSemantics\Platform\MySql\Lowering\Leaf\LiteralRule::escapes() packages/sql-semantics-mysql/src/Lowering/Leaf/LiteralRule.php:113
- static-call SqlSemantics\Platform\MySql\Statement\Literal\StringLiteral::deriveScalar() packages/sql-semantics-mysql/src/Statement/Literal/StringLiteral.php:88
- static-call SqlSemantics\Platform\MySql\Statement\Literal\TemporalLiteral::deriveScalar() packages/sql-semantics-mysql/src/Statement/Literal/TemporalLiteral.php:70
Calls 2
- class-const EscapeRule::Verbatim() line 33
- class-const EscapeRule::Backslash() line 33
Test cases 31§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 4
Other tests reaching this symbol 27
LiteralRuleTest::testEscapesFollowsTheProfilecallsMagnitudesTest::testBytesCountsTheBytesOfEachSpellingcallsJsonExtractionTest::testAHexadecimalPathIsRejectedcallsAtTimeZoneTest::testAHexadecimalZoneIsRejectedcallsStringLiteralTest::testDeriveScalarAnswersVarCharOfNoCharacterSetThatIsNeverNullcallsStringLiteralTest::testDeriveScalarRejectsALiteralSpelledUnderTheOtherEscapeRulecallsStringLiteralTest::testRejectsAnIntroducerOnANationalStringcallsStringLiteralTest::testRejectsAnUnknownIntroducercallsStringLiteralTest::testRenderKeepsBackslashesUnderTheVerbatimRulecallsTemporalLiteralTest::testDeriveScalarAnswersTheTemporalTypeThatIsNeverNullcallsTemporalLiteralTest::testDeriveScalarRejectsALiteralSpelledUnderTheOtherEscapeRulecallsTextTest::testLoweredEnumMembersHoldDecodedBytesOrDigitscallsTextTest::testLoweredTextFollowsTheEscapeRuleOfTheProfilecallsTextTest::testRejectsNonBinaryDigitscallsTextTest::testRejectsNonHexadecimalDigitscallsTextTest::testRenderKeepsBackslashesUnderTheVerbatimRulecallsTextTest::testRenderQuotesBitDigitscallsTextTest::testRenderSpellsHexadecimalDigitsByTheirCountcallsSelectTest::testAStringLiteralUnderAnotherEscapeRuleIsRejectedcallsAlterEventTest::testAHexadecimalCommentIsRejectedcallsRoutineCommentTest::testABitTextIsRejectedcallsRoutineCommentTest::testAHexadecimalTextIsRejectedcallsSqlStateTest::testRefusesABitTextcallsSqlStateTest::testRefusesAHexadecimalTextcallsCreateEventTest::testAHexadecimalCommentIsRejectedcallsCreateLoadableFunctionTest::testAHexadecimalLibraryIsRejectedcallsExternalBodyTest::testAHexadecimalCodeIsRejectedcalls
Relations§
Static calls 3
- static-call SqlSemantics\Platform\MySql\Lowering\Leaf\LiteralRule::escapes() packages/sql-semantics-mysql/src/Lowering/Leaf/LiteralRule.php:113
- static-call SqlSemantics\Platform\MySql\Statement\Literal\StringLiteral::deriveScalar() packages/sql-semantics-mysql/src/Statement/Literal/StringLiteral.php:88
- static-call SqlSemantics\Platform\MySql\Statement\Literal\TemporalLiteral::deriveScalar() packages/sql-semantics-mysql/src/Statement/Literal/TemporalLiteral.php:70
Constant reads 6
- class-const SqlSemantics\Platform\MySql\Statement\Literal\StringLiteral::__construct() packages/sql-semantics-mysql/src/Statement/Literal/StringLiteral.php:63
- class-const SqlSemantics\Platform\MySql\Statement\Literal\StringLiteral::render() packages/sql-semantics-mysql/src/Statement/Literal/StringLiteral.php:104
- class-const SqlSemantics\Platform\MySql\Statement\Literal\TemporalLiteral::__construct() packages/sql-semantics-mysql/src/Statement/Literal/TemporalLiteral.php:48
- class-const SqlSemantics\Platform\MySql\Statement\Literal\TemporalLiteral::render() packages/sql-semantics-mysql/src/Statement/Literal/TemporalLiteral.php:80
- class-const SqlSemantics\Platform\MySql\Statement\Literal\Text::__construct() packages/sql-semantics-mysql/src/Statement/Literal/Text.php:38
- class-const SqlSemantics\Platform\MySql\Statement\Literal\Text::render() packages/sql-semantics-mysql/src/Statement/Literal/Text.php:50
Type declarations 4
- type SqlSemantics\Platform\MySql\Lowering\Leaf\LiteralRule packages/sql-semantics-mysql/src/Lowering/Leaf/LiteralRule.php:111
- type SqlSemantics\Platform\MySql\Statement\Literal\StringLiteral packages/sql-semantics-mysql/src/Statement/Literal/StringLiteral.php:63
- type SqlSemantics\Platform\MySql\Statement\Literal\TemporalLiteral packages/sql-semantics-mysql/src/Statement/Literal/TemporalLiteral.php:48
- type SqlSemantics\Platform\MySql\Statement\Literal\Text packages/sql-semantics-mysql/src/Statement/Literal/Text.php:38