From: Tim Otten Date: Wed, 14 Sep 2016 20:52:46 +0000 (-0700) Subject: CRM-17789 - api/v3/ReportTemplate - Indicate type correctly X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=9d33294e51d2b8c07451938ce48f77beaa805ab2;p=civicrm-core.git CRM-17789 - api/v3/ReportTemplate - Indicate type correctly The return value of `civicrm_api*()` is generally `array`, but when used with `getvalue` it can be scalar (specifically, `string` in this case). This produces a type-warning in phan because it cannot tell that the true return type is `string`. --- diff --git a/api/v3/ReportTemplate.php b/api/v3/ReportTemplate.php index e8e98580e7..e699044778 100644 --- a/api/v3/ReportTemplate.php +++ b/api/v3/ReportTemplate.php @@ -130,7 +130,7 @@ function _civicrm_api3_report_template_getrows($params) { $params['report_id'] = civicrm_api3('report_instance', 'getvalue', array('id' => $params['instance_id'], 'return' => 'report_id')); } - $class = civicrm_api3('option_value', 'getvalue', array( + $class = (string) civicrm_api3('option_value', 'getvalue', array( 'option_group_name' => 'report_template', 'return' => 'name', 'value' => $params['report_id'],