classCharsetRule
final class CharsetRule
Lowers character set and collation names.
Rule: MYSQL-CHARSET-NAME-001. Scope: charset_name, charset_name_or_default, old_or_new_charset_name, old_or_new_charset_name_or_default, default_charset, collation_name, collation_name_or_default, opt_collate, opt_collate_explicit, default_collation. A name is an identifier or a string; the keyword BINARY at such a position is the name binary; the keyword DEFAULT is the absence of a name. The optional DEFAULT before CHARACTER SET or COLLATE and the optional equals sign of a table or database option are not kept. Constructs: Name, CharsetName, CollationName. Terminates: unit productions over strict subtrees. Source: https://dev.mysql.com/doc/refman/8.4/en/charset-syntax.html. Status: Implemented.
Methods§
public function __construct(private Lowering $lowering)Parameters
$lowering | Lowering | The lowering this rule belongs to |
Lowers a character set or collation name, or answers null for the keyword DEFAULT.
Parameters
$name | Node |
Returns
?NameThrows
ImplementationGap When the production has no ruleTest cases 1
Called from 2
Calls 6
- class-const CharsetRule::FORWARD() line 78
- class-const CharsetRule::NAMED() line 81
- class-const CharsetRule::BINARY() line 84
- new Name line 85
- class-const CharsetRule::UNNAMED() line 88
- static-call ImplementationGap::production() line 88
public function charset(Node $charset): CharsetNameLowers a character set position.
Parameters
$charset | Node |
Returns
Throws
ImplementationGap When the production has no ruleTest cases 1
Calls 2
- new CharsetName line 100
- method-call CharsetRule::name() line 100
public function collation(Node $collation): ?CollationNameLowers a collation position; an absent COLLATE clause is null.
Parameters
$collation | Node |
Returns
Throws
ImplementationGap When the production has no ruleTest cases 1
Calls 2
- new CollationName line 121
- method-call CharsetRule::name() line 121
Private surface 5§
Implementation details, listed for orientation only.
private const FORWARD = ['charset_name_or_default: charset_name' => true, 'old_or_new_charset_name_or_d…private const NAMED = ['charset_name: ident_or_text' => true, 'old_or_new_charset_name: ident_or_text…private const BINARY = ['charset_name: BINARY' => true, 'charset_name: BINARY_SYM' => true, 'old_or_ne…private const UNNAMED = ['charset_name_or_default: DEFAULT' => true, 'old_or_new_charset_name_or_defaul…private Lowering $loweringTest cases 3§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.