Verified Commit 0883f86a authored by Dave Long's avatar Dave Long
Browse files

docs: #3549362 Wrong return type in UserPermissionsForm::permissionsByProvider()

By: prudloff
By: mstrelan
By: smustgrave
By: dcam
By: benjifisher
(cherry picked from commit 4385ef7c)
parent 3c62e4ff
Loading
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -13,6 +13,9 @@
/**
 * Provides the user permissions administration form.
 *
 * @phpstan-import-type PermissionInfoList from
 *   \Drupal\user\PermissionHandlerInterface
 *
 * @internal
 */
class UserPermissionsForm extends FormBase {
@@ -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();
+11 −1
Original line number Diff line number Diff line
@@ -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