Merge pull request #14326 from civicrm/5.14
[civicrm-core.git] / CRM / Core / Permission / Drupal.php
index 060c5f2df1266ef60c51884de3bd60937434edbe..f49c0dd52ec502d7149ac6bbfd3a8e4ee827df18 100644 (file)
@@ -41,14 +41,14 @@ class CRM_Core_Permission_Drupal extends CRM_Core_Permission_DrupalBase {
   /**
    * Is this user someone with access for the entire system.
    *
-   * @var boolean
+   * @var bool
    */
   protected $_viewAdminUser = FALSE;
   protected $_editAdminUser = FALSE;
 
   /**
    * Am in in view permission or edit permission?
-   * @var boolean
+   * @var bool
    */
   protected $_viewPermission = FALSE;
   protected $_editPermission = FALSE;
@@ -61,7 +61,6 @@ class CRM_Core_Permission_Drupal extends CRM_Core_Permission_DrupalBase {
   protected $_viewPermissionedGroups;
   protected $_editPermissionedGroups;
 
-
   /**
    * Given a permission string, check for access requirements
    *
@@ -74,10 +73,10 @@ class CRM_Core_Permission_Drupal extends CRM_Core_Permission_DrupalBase {
    *   true if yes, else false
    */
   public function check($str, $userId = NULL) {
-    $str = $this->translatePermission($str, 'Drupal', array(
+    $str = $this->translatePermission($str, 'Drupal', [
       'view user account' => 'access user profiles',
       'administer users' => 'administer users',
-    ));
+    ]);
     if ($str == CRM_Core_Permission::ALWAYS_DENY_PERMISSION) {
       return FALSE;
     }
@@ -146,13 +145,13 @@ class CRM_Core_Permission_Drupal extends CRM_Core_Permission_DrupalBase {
    *   a comma separated list of email addresses
    */
   public function permissionEmails($permissionName) {
-    static $_cache = array();
+    static $_cache = [];
 
     if (isset($_cache[$permissionName])) {
       return $_cache[$permissionName];
     }
 
-    $uids = array();
+    $uids = [];
     $sql = "
       SELECT {users}.uid, {role_permission}.permission
       FROM {users}