X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=api%2Fv3%2FConstant.php;h=1b7363e4b01e811f91d847472f21ebcf4897f0de;hb=abb4c5978811c3463251e4d0ebde5d3db4c0d34a;hp=7a7df3cad9ace170750d4a29267c77ac453944ce;hpb=9d29f5f8596366df6a6ae99b97029da639e03004;p=civicrm-core.git
diff --git a/api/v3/Constant.php b/api/v3/Constant.php
index 7a7df3cad9..1b7363e4b0 100644
--- a/api/v3/Constant.php
+++ b/api/v3/Constant.php
@@ -1,5 +1,4 @@
*
activityStatus
@@ -92,9 +97,8 @@ function _civicrm_api3_constant_deprecation() {
* worldRegion
* wysiwygEditor
*
+ *
* @return array
- * @example ConstantGet.php
- * {@getfields constant_get}
*/
function civicrm_api3_constant_get($params) {
@@ -103,7 +107,6 @@ function civicrm_api3_constant_get($params) {
//ie $values = call_user_func(array('CRM_Utils_PseudoConstant', 'getConstant'), $name);
// once tests are 100% can try removing the first block & a similar block from Generic:getoptions
-
// Whitelist approach is safer
$allowedClasses = array(
'CRM_Core_PseudoConstant',
@@ -127,9 +130,9 @@ function civicrm_api3_constant_get($params) {
}
return civicrm_api3_create_success($values, $params, 'constant');
}
- else{
+ else {
$values = call_user_func(array('CRM_Utils_PseudoConstant', 'getConstant'), $name);
- if(!empty($values)){
+ if (!empty($values)) {
return civicrm_api3_create_success($values, $params, 'constant');
}
}
@@ -137,6 +140,8 @@ function civicrm_api3_constant_get($params) {
}
/**
+ * Adjust metadata for constant get action.
+ *
* @param array $params
*/
function _civicrm_api3_constant_get_spec(&$params) {
@@ -183,13 +188,12 @@ function _civicrm_api3_constant_get_spec(&$params) {
'worldRegion',
'wysiwygEditor',
);
- $params = (array
- ('name' => array(
+ $params = array(
+ 'name' => array(
'title' => 'Constant Name',
'name' => 'name',
'api.required' => 1,
- 'options' => array_combine($options, $options)
- ))
+ 'options' => array_combine($options, $options),
+ ),
);
}
-