X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=api%2Fv3%2FReportTemplate.php;h=5fd747431899a5bbafbfbb1ca0ae916f2b2bd0fe;hb=13c8d370b0943f3e0550cf41fd3f3ca3570cc8d4;hp=4237a6b14ef1c22ae637cd6d5ee20af1f9fc9f51;hpb=fa3cdb8efb79c28c9f425543815556f6cfefe9ac;p=civicrm-core.git diff --git a/api/v3/ReportTemplate.php b/api/v3/ReportTemplate.php index 4237a6b14e..5fd7474318 100644 --- a/api/v3/ReportTemplate.php +++ b/api/v3/ReportTemplate.php @@ -63,7 +63,7 @@ function civicrm_api3_report_template_create($params) { 'CRM_Core_DAO_OptionGroup', 'report_template', 'id', 'name' ); if (!empty($params['component_id']) && !is_numeric($params['component_id'])) { - $components = CRM_Core_PseudoConstant::get('CRM_Core_DAO_OptionValue', 'component_id', array('onlyActive' => FALSE, 'labelColumn' => 'name')); + $components = CRM_Core_PseudoConstant::get('CRM_Core_DAO_OptionValue', 'component_id', ['onlyActive' => FALSE, 'labelColumn' => 'name']); $params['component_id'] = array_search($params['component_id'], $components); } return civicrm_api3_option_value_create($params); @@ -80,8 +80,8 @@ function civicrm_api3_report_template_create($params) { function _civicrm_api3_report_template_create_spec(&$params) { require_once 'api/v3/OptionValue.php'; _civicrm_api3_option_value_create_spec($params); - $params['value']['api.aliases'] = array('report_url'); - $params['name']['api.aliases'] = array('class_name'); + $params['value']['api.aliases'] = ['report_url']; + $params['name']['api.aliases'] = ['class_name']; $params['option_group_id']['api.default'] = CRM_Core_DAO::getFieldValue( 'CRM_Core_DAO_OptionGroup', 'report_template', 'id', 'name' ); @@ -111,7 +111,7 @@ function civicrm_api3_report_template_delete($params) { * API result array */ function civicrm_api3_report_template_getrows($params) { - civicrm_api3_verify_one_mandatory($params, NULL, array('report_id', 'instance_id')); + civicrm_api3_verify_one_mandatory($params, NULL, ['report_id', 'instance_id']); list($rows, $instance, $metadata) = _civicrm_api3_report_template_getrows($params); $instance->cleanUpTemporaryTables(); return civicrm_api3_create_success($rows, $params, 'ReportTemplate', 'getrows', CRM_Core_DAO::$_nullObject, $metadata); @@ -128,14 +128,14 @@ function civicrm_api3_report_template_getrows($params) { */ function _civicrm_api3_report_template_getrows($params) { if (empty($params['report_id'])) { - $params['report_id'] = civicrm_api3('report_instance', 'getvalue', array('id' => $params['instance_id'], 'return' => 'report_id')); + $params['report_id'] = civicrm_api3('report_instance', 'getvalue', ['id' => $params['instance_id'], 'return' => 'report_id']); } - $class = (string) civicrm_api3('option_value', 'getvalue', array( + $class = (string) civicrm_api3('option_value', 'getvalue', [ 'option_group_name' => 'report_template', 'return' => 'name', 'value' => $params['report_id'], - ) + ] ); $reportInstance = new $class(); @@ -154,7 +154,7 @@ function _civicrm_api3_report_template_getrows($params) { $reportInstance->beginPostProcessCommon(); $sql = $reportInstance->buildQuery(); $reportInstance->addToDeveloperTab($sql); - $rows = $metadata = $requiredMetadata = array(); + $rows = $metadata = $requiredMetadata = []; $reportInstance->buildRows($sql, $rows); $reportInstance->formatDisplay($rows); @@ -174,7 +174,7 @@ function _civicrm_api3_report_template_getrows($params) { $metadata['metadata']['sql'] = $reportInstance->getReportSql(); } } - return array($rows, $reportInstance, $metadata); + return [$rows, $reportInstance, $metadata]; } /** @@ -191,6 +191,7 @@ function civicrm_api3_report_template_getstatistics($params) { $reportInstance->cleanUpTemporaryTables(); return civicrm_api3_create_success($stats, $params, 'ReportTemplate', 'getstatistics', CRM_Core_DAO::$_nullObject, $metadata); } + /** * Adjust metadata for template getrows action. * @@ -198,9 +199,9 @@ function civicrm_api3_report_template_getstatistics($params) { * Input parameters. */ function _civicrm_api3_report_template_getrows_spec(&$params) { - $params['report_id'] = array( + $params['report_id'] = [ 'title' => 'Report ID - eg. member/lapse', - ); + ]; } /* @codingStandardsIgnoreStart