classRoleMembers
final class RoleMembers
implements RoleOption
uses Snapshot
Public API: explicitly declared with
@visibility public.A role option that lists other roles: ROLE, USER, ADMIN, IN ROLE or IN GROUP.
Source: https://www.postgresql.org/docs/17/sql-createrole.html.
$operation = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('CREATE ROLE joe IN ROLE staff, sales');
[$operation->statement->options[0]->kind->value, count($operation->statement->options[0]->roles)] // => ['IN ROLE', 2]Properties§
public non-empty-list<RoleSpec> $rolespublic RoleMembersKind $kindMethods§
public function __construct(public RoleMembersKind $kind, list<RoleSpec> $roles)Parameters
$kind | RoleMembersKind | The spelling, which tells what the list means |
$roles | list<RoleSpec> | The listed roles in the order written, at least one |
Calls 2
- static-call Check::listOf() line 37
- class-const RoleSpec::class() line 37
public function option(): stringAnswers the option the list fills.
Returns
stringTest cases 1
Calls 1
- method-call RoleMembersKind::option() line 45
public function render(Output $out): voidWrites the keywords and the roles.
Parameters
$out | Output |
Calls 2
- method-call Output::keyword() line 53
- function-call
explodeline 53
Test cases 5§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 2
Other tests reaching this symbol 3
Relations§
Instantiated in 1
Type checks 2
- instanceof SqlSemantics\Platform\PostgreSql\Rules\Access\RoleChecks::options() packages/sql-semantics-postgres/src/Rules/Access/RoleChecks.php:58
- instanceof SqlSemantics\Platform\PostgreSql\Statement\Catalog\Access\Role\AlterRole::__construct() packages/sql-semantics-postgres/src/Statement/Catalog/Access/Role/AlterRole.php:52