classRules
final class Rules
Restricted visibility: declared "@visibility SqlFormatter". Code outside that scope must not name this declaration.
Grammar-owned layout roles supplied by a dialect implementation.
Properties§
public array<string, list<string>> $rolespublic list<string> $headersMethods§
public function __construct(
public array<string, list<string>> $roles,
public list<string> $headers,
)Parameters
$roles | array<string, list<string>> | Grammar rules grouped by layout role |
$headers | list<string> | Recognized clause keyword sequences |
public function has(string $role, string $name): boolDetermines whether a grammar rule has a given layout role.
Parameters
$role | string | |
$name | string |
Returns
boolTest cases 1
Called from 9
- method-call SqlFormatter\Core\Syntax\Analyzer::visit() packages/sql-formatter/src/Core/Syntax/Analyzer.php:40
- method-call SqlFormatter\Core\Syntax\Analyzer::visit() packages/sql-formatter/src/Core/Syntax/Analyzer.php:43
- method-call SqlFormatter\Core\Syntax\Expressions::mark() packages/sql-formatter/src/Core/Syntax/Expressions.php:26
- method-call SqlFormatter\Core\Syntax\Markers::apply() packages/sql-formatter/src/Core/Syntax/Markers.php:26
- method-call SqlFormatter\Core\Syntax\Markers::apply() packages/sql-formatter/src/Core/Syntax/Markers.php:29
- method-call SqlFormatter\Core\Syntax\Markers::apply() packages/sql-formatter/src/Core/Syntax/Markers.php:37
- method-call SqlFormatter\Core\Syntax\Markers::apply() packages/sql-formatter/src/Core/Syntax/Markers.php:40
- method-call SqlFormatter\Core\Syntax\Markers::apply() packages/sql-formatter/src/Core/Syntax/Markers.php:44
- method-call SqlFormatter\Core\Syntax\Markers::apply() packages/sql-formatter/src/Core/Syntax/Markers.php:48
Calls 1
- function-call
in_arrayline 27
Test cases 16§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
Other tests reaching this symbol 15
SettingsTestcallsDialectTest::testSyntaxRulesCanProvideAnIndependentGrammarcallsFormatterTest::testFormatUsesInjectedParserAndGrammarRolescallsBlockTestcallsElementsTestcallsHeadersTestcallsRendererTestcallsAnalyzerTestcallsDocumentTestcallsListsTestcallsMarkersTestcallsFormatterTestcallsDialectTestcallsDialectTestcallsDialectTestcalls
Relations§
Instantiated in 3
- new SqlFormatter\Platform\MySql\Dialect::syntaxRules() packages/sql-formatter/src/Platform/MySql/Dialect.php:27
- new SqlFormatter\Platform\PostgreSql\Dialect::syntaxRules() packages/sql-formatter/src/Platform/PostgreSql/Dialect.php:27
- new SqlFormatter\Platform\Sqlite\Dialect::syntaxRules() packages/sql-formatter/src/Platform/Sqlite/Dialect.php:27
Method calls 9
- method-call SqlFormatter\Core\Syntax\Analyzer::visit() packages/sql-formatter/src/Core/Syntax/Analyzer.php:40
- method-call SqlFormatter\Core\Syntax\Analyzer::visit() packages/sql-formatter/src/Core/Syntax/Analyzer.php:43
- method-call SqlFormatter\Core\Syntax\Expressions::mark() packages/sql-formatter/src/Core/Syntax/Expressions.php:26
- method-call SqlFormatter\Core\Syntax\Markers::apply() packages/sql-formatter/src/Core/Syntax/Markers.php:26
- method-call SqlFormatter\Core\Syntax\Markers::apply() packages/sql-formatter/src/Core/Syntax/Markers.php:29
- method-call SqlFormatter\Core\Syntax\Markers::apply() packages/sql-formatter/src/Core/Syntax/Markers.php:37
- method-call SqlFormatter\Core\Syntax\Markers::apply() packages/sql-formatter/src/Core/Syntax/Markers.php:40
- method-call SqlFormatter\Core\Syntax\Markers::apply() packages/sql-formatter/src/Core/Syntax/Markers.php:44
- method-call SqlFormatter\Core\Syntax\Markers::apply() packages/sql-formatter/src/Core/Syntax/Markers.php:48
Type declarations 9
- type SqlFormatter\Core\Dialect packages/sql-formatter/src/Core/Dialect.php:20
- type SqlFormatter\Core\Syntax\Analyzer packages/sql-formatter/src/Core/Syntax/Analyzer.php:20
- type SqlFormatter\Core\Syntax\Document packages/sql-formatter/src/Core/Syntax/Document.php:64
- type SqlFormatter\Core\Syntax\Expressions packages/sql-formatter/src/Core/Syntax/Expressions.php:17
- type SqlFormatter\Core\Syntax\Headers packages/sql-formatter/src/Core/Syntax/Headers.php:17
- type SqlFormatter\Core\Syntax\Markers packages/sql-formatter/src/Core/Syntax/Markers.php:17
- type SqlFormatter\Platform\MySql\Dialect packages/sql-formatter/src/Platform/MySql/Dialect.php:25
- type SqlFormatter\Platform\PostgreSql\Dialect packages/sql-formatter/src/Platform/PostgreSql/Dialect.php:25
- type SqlFormatter\Platform\Sqlite\Dialect packages/sql-formatter/src/Platform/Sqlite/Dialect.php:25