Skip to content

Commit

Permalink
[NFC code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
eileenmcnaughton committed Nov 1, 2019
1 parent b99064a commit 76d9be7
Showing 1 changed file with 27 additions and 7 deletions.
34 changes: 27 additions & 7 deletions CRM/Extendedreport/Form/Report/ExtendedReport.php
Original file line number Diff line number Diff line change
Expand Up @@ -1646,6 +1646,7 @@ function getOperationPair($type = "string", $fieldName = NULL) {
* @param string $action
*
* @return array
* @throws \CiviCRM_API3_Exception
*/
protected function _getOptions($entity, $field, $action = 'get') {
static $allOptions = [];
Expand Down Expand Up @@ -1860,10 +1861,15 @@ function postProcess() {
* @param integer $rowFieldId
* @param string $columnType = month / year
* @param string $header = `contribution_total_amount_year` / 'contribution_total_amount_year'
* @param array $params
*
* @return array
*
* @return array
* @throws \CiviCRM_API3_Exception
* @throws \CiviCRM_API3_Exception
*/
function buildContributionTotalAmountBybreakdown($rowFieldId = NULL, $columnType, $header, $params) {
if ($header == 'contribution_total_amount_year' || $header == 'contribution_total_amount_month') {
function buildContributionTotalAmountBybreakdown($rowFieldId, $columnType, $header) {
if ($header === 'contribution_total_amount_year' || $header == 'contribution_total_amount_month') {
$where = '';
$clause = '';

Expand Down Expand Up @@ -2906,6 +2912,7 @@ function alterRollupRows(&$rows) {
* @param array $specs
*
* @return string
* @throws \Exception
*/
function alterFromOptions($value, &$row, $selectedField, $criteriaFieldName, $specs) {
if ($specs['data_type'] == 'ContactReference') {
Expand All @@ -2924,6 +2931,9 @@ function alterFromOptions($value, &$row, $selectedField, $criteriaFieldName, $sp
* Am using it in a pretty hacky way to also cover the select box custom fields
*
* @param $rows
*
* @throws \CRM_Core_Exception
* @throws \CiviCRM_API3_Exception
*/
function alterCustomDataDisplay(&$rows) {

Expand Down Expand Up @@ -3064,6 +3074,7 @@ protected function commaSeparateCustomValues($value) {
* @param array $row
*
* @return float|string
* @throws \CRM_Core_Exception
*/
function formatCustomValues($value, $customField, $fieldValueMap, $row = []) {
// @todo this might hopefully be already done by metadata - for booleans it is.
Expand Down Expand Up @@ -3307,14 +3318,14 @@ protected function getColumns($type, $options = []) {
*
* @param array $specs
* @param string $tableName
* @param string $tableAlias
* @param string $daoName
* @param string $tableAlias
* @param array $defaults
* @param array $options Options
* - group_title
*
* @return array
* @throws \CiviCRM_API3_Exception
*/
protected function buildColumns($specs, $tableName, $daoName = NULL, $tableAlias = NULL, $defaults = [], $options = []) {

Expand Down Expand Up @@ -4623,7 +4634,6 @@ protected function getPledgeColumns($options = []) {
/**
* Get email columns.
*
* @param array $options column options
* @param array $options
*
* @return array
Expand Down Expand Up @@ -4661,7 +4671,6 @@ function getEmailColumns($options = []) {
/**
* Get email columns.
*
* @param array $options column options
* @param array $options
*
* @return array
Expand Down Expand Up @@ -4889,6 +4898,7 @@ protected function getRelationshipTypeColumns($options = []) {
*
* @return array
* Options in a format id => label
* @throws \CiviCRM_API3_Exception
*/
protected function getRelationshipABOptions() {
$relationshipTypes = civicrm_api3('relationship_type', 'get', [
Expand Down Expand Up @@ -5195,6 +5205,8 @@ function getBillingAddressColumns($options = []) {
* @param $value
* @param $row
*
* @param $selectedField
*
* @return string
*/
function alterBillingName($value, &$row, $selectedField) {
Expand Down Expand Up @@ -6310,6 +6322,7 @@ function alterNickName($value, &$row) {
* @param $selectedField
* @param $criteriaFieldName
*
* @param $specs
* @return string
*/
function alterFinancialType($value, &$row, $selectedField, $criteriaFieldName, $specs) {
Expand Down Expand Up @@ -6353,6 +6366,9 @@ function alterContributionStatus($value, &$row) {
* @param $value
* @param $row
*
* @param $selectedField
* @param $criteriaFieldName
* @param $spec
* @return string
*/
function alterByOptions($value, &$row, $selectedField, $criteriaFieldName, $spec) {
Expand Down Expand Up @@ -6400,7 +6416,7 @@ function alterEventType($value, &$row) {
/**
* @param int|null $value
* @param array $row
* @param string $selectedfield
* @param string $selectedField
*
* @return string
* Name of primary participant.
Expand Down Expand Up @@ -7400,6 +7416,7 @@ protected function isInProcessOfPreconstraining() {
* See address history for the latter option & LineitemMembership for the former.
*
* @return int|null
* @throws \CRM_Core_Exception
*/
protected function getContactIdFilter() {
if (!empty($this->_defaults['contact_id_filter_field'])) {
Expand All @@ -7422,6 +7439,7 @@ protected function getContactIdFilter() {
* @param $table
*
* @return array
* @throws \CiviCRM_API3_Exception
*/
protected function getMetadataForFields($table) {
// higher preference to bao object
Expand Down Expand Up @@ -7982,6 +8000,7 @@ protected function addCustomTableToColumns($field, $currentTable, $prefix, $pref
* @param string $prefix
*
* @return mixed
* @throws \CiviCRM_API3_Exception
*/
protected function getCustomFieldMetadata($field, $prefixLabel, $prefix = '') {
$field = array_merge($field, [
Expand Down Expand Up @@ -8130,6 +8149,7 @@ protected function getOperatorType($type, $spec = [], $table = '') {
* @param string $prefix
*
* @return array
* @throws \CiviCRM_API3_Exception
*/
protected function getQillForField($field, $fieldName, $prefix = '') {
if ((CRM_Utils_Array::value('type', $field) & CRM_Utils_Type::T_DATE ||
Expand Down

0 comments on commit 76d9be7

Please sign in to comment.