classUserListRule
final class UserListRule
Lowers the account lists of CREATE USER, ALTER USER and MySQL 5.x GRANT.
Rule: MYSQL-ACCOUNT-LIST-001. Scope: create_user_list, create_user, alter_user_list, alter_user (8.0+), grant_list, grant_user (5.x). Each entry is the account with what the statement sets for it, as LEX_USER holds it; the multi-factor forms of ALTER USER are factor changes. Constructs: UserSpecification, FactorChange, FactorStep. Terminates: the lists are flattened iteratively; every other child is a strict subtree. Source: https://dev.mysql.com/doc/refman/8.4/en/create-user.html, https://dev.mysql.com/doc/refman/8.4/en/alter-user.html, https://dev.mysql.com/doc/refman/5.7/en/grant.html. Status: Implemented.
Methods§
public function __construct(
private Lowering $lowering,
private IdentificationRule $identifications,
)Parameters
$lowering | Lowering | The lowering this rule belongs to |
$identifications | IdentificationRule | The authentication clause rules |
public function created(Node $list): list<UserSpecification>Lowers a create_user_list.
Parameters
$list | Node |
Returns
list<UserSpecification>Throws
ImplementationGap When a production has no ruleCalled from 1
Calls 2
- method-call UserListRule::spine() line 91
- method-call UserListRule::create() line 92
public function create(Node $user): UserSpecificationLowers one create_user.
Parameters
$user | Node |
Returns
Throws
ImplementationGap When the production has no ruleCalled from 1
Calls 6
- method-call Lowering::form() line 105
- new UserSpecification line 109
- method-call IdentificationRule::identification() line 109
- method-call IdentificationRule::factors() line 109
- method-call IdentificationRule::initial() line 110
- static-call ImplementationGap::production() line 112
public function altered(Node $list): list<UserAlteration>Lowers an 8.0 alter_user_list.
Parameters
$list | Node |
Returns
list<UserAlteration>Throws
ImplementationGap When a production has no ruleCalled from 1
Calls 2
- method-call UserListRule::spine() line 125
- method-call UserListRule::alter() line 126
public function alter(Node $user): UserAlterationLowers one 8.0 alter_user.
Parameters
$user | Node |
Returns
Throws
ImplementationGap When the production has no ruleCalled from 1
Calls 11
- method-call Lowering::form() line 139
- function-call
array_key_existsline 141 - class-const UserListRule::CHANGES() line 141
- method-call IdentificationRule::identification() line 143
- new UserSpecification line 146
- method-call IdentificationRule::retain() line 146
- function-call
countline 146 - class-const UserListRule::FACTORS() line 148
- method-call UserListRule::factors() line 149
- method-call IdentificationRule::discard() line 154
- static-call ImplementationGap::production() line 155
public function factors(Form $form, Account $account): FactorChangeLowers the factor change forms of alter_user.
Returns
Called from 1
Calls 7
- class-const UserListRule::FACTORS() line 164
- class-const FactorAction::Drop() line 165
- method-call IdentificationRule::factor() line 169
- method-call Form::node() line 169
- new FactorStep line 170
- method-call IdentificationRule::identification() line 170
- new FactorChange line 173
public function granted(Node $list): non-empty-list<UserSpecification>Lowers a MySQL 5.x grant_list.
Parameters
$list | Node |
Returns
non-empty-list<UserSpecification>Throws
ImplementationGap When a production has no ruleCalled from 6
- method-call SqlSemantics\Platform\MySql\Lowering\Account\LegacyGrantRule::grant() packages/sql-semantics-mysql/src/Lowering/Account/LegacyGrantRule.php:75
- method-call SqlSemantics\Platform\MySql\Lowering\Account\LegacyGrantRule::grant() packages/sql-semantics-mysql/src/Lowering/Account/LegacyGrantRule.php:85
- method-call SqlSemantics\Platform\MySql\Lowering\Account\LegacyGrantRule::users() packages/sql-semantics-mysql/src/Lowering/Account/LegacyGrantRule.php:138
- method-call SqlSemantics\Platform\MySql\Lowering\Account\UserStatementRule::definition() packages/sql-semantics-mysql/src/Lowering/Account/UserStatementRule.php:76
- method-call SqlSemantics\Platform\MySql\Lowering\Account\UserStatementRule::definition() packages/sql-semantics-mysql/src/Lowering/Account/UserStatementRule.php:79
- method-call SqlSemantics\Platform\MySql\Lowering\Account\UserStatementRule::definition() packages/sql-semantics-mysql/src/Lowering/Account/UserStatementRule.php:97
Calls 2
- method-call UserListRule::spine() line 185
- method-call UserListRule::grant() line 186
public function grant(Node $user): UserSpecificationLowers one MySQL 5.x grant_user.
Parameters
$user | Node |
Returns
Throws
ImplementationGap When the production has no ruleCalled from 1
Calls 10
- method-call Lowering::form() line 199
- new ClauseRule line 201
- new UserSpecification line 203
- new Identification line 205
- class-const Credential::Password() line 205
- method-call ClauseRule::string() line 205
- class-const Credential::PasswordHash() line 206
- class-const Credential::None() line 207
- class-const Credential::Hash() line 208
- static-call ImplementationGap::production() line 210
Answers the items of a list production of this rule, in source order.
Parameters
$list | Node |
Returns
non-empty-list<Node>Throws
ImplementationGap When the production has no ruleCalled from 3
- method-call SqlSemantics\Platform\MySql\Lowering\Account\UserListRule::created() packages/sql-semantics-mysql/src/Lowering/Account/UserListRule.php:91
- method-call SqlSemantics\Platform\MySql\Lowering\Account\UserListRule::altered() packages/sql-semantics-mysql/src/Lowering/Account/UserListRule.php:125
- method-call SqlSemantics\Platform\MySql\Lowering\Account\UserListRule::granted() packages/sql-semantics-mysql/src/Lowering/Account/UserListRule.php:185
Calls 6
- method-call Lowering::form() line 222
- class-const UserListRule::LISTS() line 223
- static-call ImplementationGap::production() line 224
- method-call Lists::items() line 226
- new Lists line 226
- static-call Check::invariant() line 227
Private surface 5§
Implementation details, listed for orientation only.
private const CHANGES = ['alter_user: user identified_by_password REPLACE_SYM TEXT_STRING_password opt_…private const FACTORS = ['alter_user: user ADD factor identification' => [\SqlSemantics\Platform\MySql\…private const LISTS = ['create_user_list: create_user' => true, 'create_user_list: create_user_list ,…private Lowering $loweringprivate IdentificationRule $identificationsTest cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
UserListRuleTestcalls
Relations§
Instantiated in 3
- new SqlSemantics\Platform\MySql\Lowering\Account\LegacyGrantRule::grant() packages/sql-semantics-mysql/src/Lowering/Account/LegacyGrantRule.php:72
- new SqlSemantics\Platform\MySql\Lowering\Account\LegacyGrantRule::users() packages/sql-semantics-mysql/src/Lowering/Account/LegacyGrantRule.php:138
- new SqlSemantics\Platform\MySql\Lowering\Account\UserStatementRule::__construct() packages/sql-semantics-mysql/src/Lowering/Account/UserStatementRule.php:62
Method calls 8
- method-call SqlSemantics\Platform\MySql\Lowering\Account\LegacyGrantRule::grant() packages/sql-semantics-mysql/src/Lowering/Account/LegacyGrantRule.php:75
- method-call SqlSemantics\Platform\MySql\Lowering\Account\LegacyGrantRule::grant() packages/sql-semantics-mysql/src/Lowering/Account/LegacyGrantRule.php:85
- method-call SqlSemantics\Platform\MySql\Lowering\Account\LegacyGrantRule::users() packages/sql-semantics-mysql/src/Lowering/Account/LegacyGrantRule.php:138
- method-call SqlSemantics\Platform\MySql\Lowering\Account\UserStatementRule::definition() packages/sql-semantics-mysql/src/Lowering/Account/UserStatementRule.php:76
- method-call SqlSemantics\Platform\MySql\Lowering\Account\UserStatementRule::definition() packages/sql-semantics-mysql/src/Lowering/Account/UserStatementRule.php:79
- method-call SqlSemantics\Platform\MySql\Lowering\Account\UserStatementRule::definition() packages/sql-semantics-mysql/src/Lowering/Account/UserStatementRule.php:87
- method-call SqlSemantics\Platform\MySql\Lowering\Account\UserStatementRule::definition() packages/sql-semantics-mysql/src/Lowering/Account/UserStatementRule.php:97
- method-call SqlSemantics\Platform\MySql\Lowering\Account\UserStatementRule::alter() packages/sql-semantics-mysql/src/Lowering/Account/UserStatementRule.php:135