Loading core/modules/user/src/Form/UserPermissionsForm.php +8 −2 Original line number Diff line number Diff line Loading @@ -13,6 +13,9 @@ /** * Provides the user permissions administration form. * * @phpstan-import-type PermissionInfoList from * \Drupal\user\PermissionHandlerInterface * * @internal */ class UserPermissionsForm extends FormBase { Loading Loading @@ -92,9 +95,12 @@ protected function getRoles() { /** * Group permissions by the modules that provide them. * * @return string[][] * @return array<string, PermissionInfoList> * A nested array. The outer keys are modules that provide permissions. The * inner arrays are permission names keyed by their machine names. * inner arrays contain permissions info as defined in * PermissionHandlerInterface. * * @see \Drupal\user\PermissionHandlerInterface::getPermissions */ protected function permissionsByProvider(): array { $permissions = $this->permissionHandler->getPermissions(); Loading core/modules/user/src/PermissionHandlerInterface.php +11 −1 Original line number Diff line number Diff line Loading @@ -4,13 +4,23 @@ /** * Defines an interface to list available permissions. * * @phpstan-type PermissionInfo array { * title: string, * description?: string|\Stringable, * "restrict access"?: bool, * warning?: string|\Stringable, * dependencies?: array, * provider: string, * } * @phpstan-type PermissionInfoList array<string, PermissionInfo> */ interface PermissionHandlerInterface { /** * Gets all available permissions. * * @return array * @return PermissionInfoList * An array whose keys are permission names and whose corresponding values * are arrays containing the following key-value pairs: * - title: The human-readable name of the permission, to be shown on the Loading Loading
core/modules/user/src/Form/UserPermissionsForm.php +8 −2 Original line number Diff line number Diff line Loading @@ -13,6 +13,9 @@ /** * Provides the user permissions administration form. * * @phpstan-import-type PermissionInfoList from * \Drupal\user\PermissionHandlerInterface * * @internal */ class UserPermissionsForm extends FormBase { Loading Loading @@ -92,9 +95,12 @@ protected function getRoles() { /** * Group permissions by the modules that provide them. * * @return string[][] * @return array<string, PermissionInfoList> * A nested array. The outer keys are modules that provide permissions. The * inner arrays are permission names keyed by their machine names. * inner arrays contain permissions info as defined in * PermissionHandlerInterface. * * @see \Drupal\user\PermissionHandlerInterface::getPermissions */ protected function permissionsByProvider(): array { $permissions = $this->permissionHandler->getPermissions(); Loading
core/modules/user/src/PermissionHandlerInterface.php +11 −1 Original line number Diff line number Diff line Loading @@ -4,13 +4,23 @@ /** * Defines an interface to list available permissions. * * @phpstan-type PermissionInfo array { * title: string, * description?: string|\Stringable, * "restrict access"?: bool, * warning?: string|\Stringable, * dependencies?: array, * provider: string, * } * @phpstan-type PermissionInfoList array<string, PermissionInfo> */ interface PermissionHandlerInterface { /** * Gets all available permissions. * * @return array * @return PermissionInfoList * An array whose keys are permission names and whose corresponding values * are arrays containing the following key-value pairs: * - title: The human-readable name of the permission, to be shown on the Loading