X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=Civi%2FAPI%2FWhitelistRule.php;h=763e99b1edef7fbc787194b65da82cfd0fab590b;hb=f299f7db79fed6f3598c84302966bda087e7cac3;hp=0090638f6798e89f5f9e85e5a065d78b76639438;hpb=49cfbaed65e6920698d83b57985df1eb228479a2;p=civicrm-core.git diff --git a/Civi/API/WhitelistRule.php b/Civi/API/WhitelistRule.php index 0090638f67..763e99b1ed 100644 --- a/Civi/API/WhitelistRule.php +++ b/Civi/API/WhitelistRule.php @@ -3,7 +3,7 @@ +--------------------------------------------------------------------+ | CiviCRM version 5 | +--------------------------------------------------------------------+ - | Copyright CiviCRM LLC (c) 2004-2019 | + | Copyright CiviCRM LLC (c) 2004-2020 | +--------------------------------------------------------------------+ | This file is a part of CiviCRM. | | | @@ -48,7 +48,7 @@ namespace Civi\API; */ class WhitelistRule { - static $IGNORE_FIELDS = array( + public static $IGNORE_FIELDS = [ 'check_permissions', 'debug', 'offset', @@ -61,7 +61,7 @@ class WhitelistRule { 'sequential', 'sort', 'version', - ); + ]; /** * Create a batch of rules from an array. @@ -70,7 +70,7 @@ class WhitelistRule { * @return array */ public static function createAll($rules) { - $whitelist = array(); + $whitelist = []; foreach ($rules as $rule) { $whitelist[] = new WhitelistRule($rule); } @@ -126,7 +126,7 @@ class WhitelistRule { $this->actions = '*'; } else { - $this->actions = array(); + $this->actions = []; foreach ((array) $ruleSpec['actions'] as $action) { $this->actions[] = Request::normalizeActionName($action, $ruleSpec['version']); } @@ -197,7 +197,7 @@ class WhitelistRule { // Kind'a silly we need to (re(re))parse here for each rule; would be more // performant if pre-parsed by Request::create(). $options = _civicrm_api3_get_options_from_params($apiRequest['params'], TRUE, $apiRequest['entity'], 'get'); - $return = \CRM_Utils_Array::value('return', $options, array()); + $return = \CRM_Utils_Array::value('return', $options, []); $activatedFields = array_merge($activatedFields, array_keys($return)); } @@ -267,7 +267,7 @@ class WhitelistRule { * List of acceptable keys. */ protected function filterFields($keys) { - $r = array(); + $r = []; foreach ($keys as $key) { if (in_array($key, $this->fields)) { $r[] = $key;