X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=api%2Fv3%2FSetting.php;h=7e9ea8ffa36ea1efb48412c8457396a726ed0c54;hb=49efc06e32bcd18ad6ad150ed00157ca3aff2903;hp=2f6e7ee6d834fd504d36a30d1ba1ea5dc2ee52a0;hpb=5c50035da722d2d4b9f4ff2e30faeb6ba9772318;p=civicrm-core.git diff --git a/api/v3/Setting.php b/api/v3/Setting.php index 2f6e7ee6d8..7e9ea8ffa3 100644 --- a/api/v3/Setting.php +++ b/api/v3/Setting.php @@ -248,6 +248,9 @@ function _civicrm_api3_setting_fill_spec(&$params) { * * @return array * api result array + * + * @throws \API_Exception + * @throws \CiviCRM_API3_Exception */ function civicrm_api3_setting_create($params) { $domains = _civicrm_api3_setting_getDomainArray($params); @@ -379,24 +382,24 @@ function _civicrm_api3_setting_getvalue_spec(&$params) { * @param array $params * * @return array - * @throws \Exception + * @throws API_Exception */ function _civicrm_api3_setting_getDomainArray(&$params) { if (empty($params['domain_id']) && isset($params['id'])) { $params['domain_id'] = $params['id']; } - if ($params['domain_id'] == 'current_domain') { + if ($params['domain_id'] === 'current_domain') { $params['domain_id'] = CRM_Core_Config::domainID(); } - if ($params['domain_id'] == 'all') { + if ($params['domain_id'] === 'all') { $domainAPIResult = civicrm_api('domain', 'get', ['version' => 3, 'return' => 'id']); if (isset($domainAPIResult['values'])) { $params['domain_id'] = array_keys($domainAPIResult['values']); } else { - throw new Exception('All domains not retrieved - problem with Domain Get api call ' . $domainAPIResult['error_message']); + throw new API_Exception('All domains not retrieved - problem with Domain Get api call ' . $domainAPIResult['error_message']); } } if (is_array($params['domain_id'])) {