From c86d4e7c0607f85961b5b94a98a47cf3bf3ae44f Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Sun, 7 Apr 2019 13:44:57 +1000 Subject: [PATCH] (NFC) Update coding style in PCP, Pledge, Profile, Queue, Report folders --- CRM/PCP/BAO/PCP.php | 3 +- CRM/PCP/Form/Event.php | 7 ++--- CRM/PCP/Form/PCP.php | 6 ++-- CRM/PCP/Form/PCPAccount.php | 3 +- CRM/PCP/Page/PCP.php | 2 +- CRM/Pledge/BAO/Pledge.php | 11 +++---- CRM/Pledge/BAO/Query.php | 1 + CRM/Pledge/Form/Payment.php | 3 +- CRM/Pledge/Form/Pledge.php | 31 ++++++++++--------- CRM/Pledge/Form/PledgeView.php | 3 +- CRM/Pledge/Form/Search.php | 1 + CRM/Pledge/Form/Task.php | 3 +- CRM/Pledge/Form/Task/Print.php | 3 +- CRM/Pledge/Form/Task/Result.php | 3 +- CRM/Pledge/Form/Task/SearchTaskHookSample.php | 3 +- CRM/Pledge/Info.php | 2 +- CRM/Pledge/Selector/Search.php | 6 ++-- CRM/Pledge/Task.php | 2 +- CRM/Profile/Form.php | 4 ++- CRM/Profile/Page/Dynamic.php | 5 ++- CRM/Profile/Page/Listings.php | 1 + .../Page/MultipleRecordFieldsListing.php | 2 +- CRM/Profile/Selector/Listings.php | 5 +-- CRM/Queue/ErrorPolicy.php | 16 +++++----- CRM/Queue/Queue.php | 20 ++++++------ CRM/Queue/Runner.php | 5 ++- CRM/Report/DAO/ReportInstance.php | 4 +-- CRM/Report/Form.php | 30 ++++++++++-------- CRM/Report/Form/Campaign/SurveyDetails.php | 17 +++++----- CRM/Report/Form/Case/Detail.php | 3 +- CRM/Report/Form/Contact/LoggingDetail.php | 1 + CRM/Report/Form/Contact/LoggingSummary.php | 1 + CRM/Report/Form/Contribute/Bookkeeping.php | 9 +++--- .../Form/Contribute/DeferredRevenue.php | 1 + CRM/Report/Form/Contribute/History.php | 7 ++++- CRM/Report/Form/Contribute/Lybunt.php | 6 ++-- CRM/Report/Form/Contribute/Recur.php | 1 - CRM/Report/Form/Contribute/RecurSummary.php | 1 + CRM/Report/Form/Contribute/Repeat.php | 2 +- CRM/Report/Form/Contribute/Summary.php | 11 ++++--- CRM/Report/Form/Event/ParticipantListing.php | 3 +- CRM/Report/Form/Extended.php | 4 +-- CRM/Report/Form/Instance.php | 3 +- CRM/Report/Form/Mailing/Summary.php | 6 ++-- CRM/Report/Form/Membership/Summary.php | 8 ++--- CRM/Report/Form/Pledge/Detail.php | 6 ++-- CRM/Report/Form/Pledge/Pbnp.php | 8 ++--- CRM/Report/Form/Register.php | 12 +++---- CRM/Report/Info.php | 7 +++-- CRM/Report/Page/Instance.php | 1 + CRM/Report/Page/InstanceList.php | 6 ++-- CRM/Report/Page/Options.php | 8 ++--- 52 files changed, 169 insertions(+), 148 deletions(-) diff --git a/CRM/PCP/BAO/PCP.php b/CRM/PCP/BAO/PCP.php index f5674c558b..367fa10429 100644 --- a/CRM/PCP/BAO/PCP.php +++ b/CRM/PCP/BAO/PCP.php @@ -37,7 +37,7 @@ class CRM_PCP_BAO_PCP extends CRM_PCP_DAO_PCP { * * @var array */ - static $_pcpLinks = NULL; + public static $_pcpLinks = NULL; /** * Class constructor. @@ -407,7 +407,6 @@ WHERE pcp.id = %1 AND cc.contribution_status_id =1 AND cc.is_test = 0"; $form->add('text', 'notify_email', ts('Notify Email'), CRM_Core_DAO::getAttribute('CRM_PCP_DAO_PCPBlock', 'notify_email')); } - /** * Add PCP form elements to a form. * diff --git a/CRM/PCP/Form/Event.php b/CRM/PCP/Form/Event.php index 0be13e2b77..da7802382b 100644 --- a/CRM/PCP/Form/Event.php +++ b/CRM/PCP/Form/Event.php @@ -46,7 +46,6 @@ class CRM_PCP_Form_Event extends CRM_Event_Form_ManageEvent { */ public $_component = 'event'; - public function preProcess() { parent::preProcess(); $this->assign('selectedChild', 'pcp'); @@ -120,9 +119,9 @@ class CRM_PCP_Form_Event extends CRM_Event_Form_ManageEvent { if (!empty($pcpBlock->id) && CRM_PCP_BAO_PCP::getPcpBlockInUse($pcpBlock->id)) { foreach ([ - 'target_entity_type', - 'target_entity_id', - ] as $element_name) { + 'target_entity_type', + 'target_entity_id', + ] as $element_name) { $element = $this->getElement($element_name); $element->freeze(); } diff --git a/CRM/PCP/Form/PCP.php b/CRM/PCP/Form/PCP.php index cf05504152..ff39071278 100644 --- a/CRM/PCP/Form/PCP.php +++ b/CRM/PCP/Form/PCP.php @@ -145,8 +145,7 @@ class CRM_PCP_Form_PCP extends CRM_Core_Form { 'type' => 'cancel', 'name' => ts('Cancel'), ], - ] - ); + ]); } else { @@ -170,8 +169,7 @@ class CRM_PCP_Form_PCP extends CRM_Core_Form { 'spacing' => '         ', 'isDefault' => TRUE, ], - ] - ); + ]); parent::buildQuickForm(); } } diff --git a/CRM/PCP/Form/PCPAccount.php b/CRM/PCP/Form/PCPAccount.php index 84c9b316a1..ccac09cf54 100644 --- a/CRM/PCP/Form/PCPAccount.php +++ b/CRM/PCP/Form/PCPAccount.php @@ -40,6 +40,7 @@ class CRM_PCP_Form_PCPAccount extends CRM_Core_Form { /** * Variable defined for Contribution Page Id. + * @var int */ public $_pageId = NULL; public $_id = NULL; @@ -265,7 +266,7 @@ class CRM_PCP_Form_PCPAccount extends CRM_Core_Form { } } - $this->_contactID = CRM_Contact_BAO_Contact::getFirstDuplicateContact($params, 'Individual', 'Unsupervised', [], FALSE); + $this->_contactID = CRM_Contact_BAO_Contact::getFirstDuplicateContact($params, 'Individual', 'Unsupervised', [], FALSE); $contactID = CRM_Contact_BAO_Contact::createProfileContact($params, $this->_fields, $this->_contactID); $this->set('contactID', $contactID); diff --git a/CRM/PCP/Page/PCP.php b/CRM/PCP/Page/PCP.php index 32f828d4f1..58768df2e0 100644 --- a/CRM/PCP/Page/PCP.php +++ b/CRM/PCP/Page/PCP.php @@ -43,7 +43,7 @@ class CRM_PCP_Page_PCP extends CRM_Core_Page_Basic { * * @var array */ - static $_links = NULL; + public static $_links = NULL; /** * Get BAO Name. diff --git a/CRM/Pledge/BAO/Pledge.php b/CRM/Pledge/BAO/Pledge.php index f934eb63bb..62b4dfa740 100644 --- a/CRM/Pledge/BAO/Pledge.php +++ b/CRM/Pledge/BAO/Pledge.php @@ -37,7 +37,7 @@ class CRM_Pledge_BAO_Pledge extends CRM_Pledge_DAO_Pledge { * * @var array */ - static $_exportableFields = NULL; + public static $_exportableFields = NULL; /** * Class constructor. @@ -798,10 +798,10 @@ GROUP BY currency // get pending and in progress status foreach (array( - 'Pending', - 'In Progress', - 'Overdue', - ) as $name) { + 'Pending', + 'In Progress', + 'Overdue', + ) as $name) { if ($statusId = array_search($name, $pledgeStatuses)) { $status[] = $statusId; } @@ -1174,7 +1174,6 @@ SELECT pledge.contact_id as contact_id, return array_flip(array_intersect($paymentStatus, array('Overdue', 'Pending'))); } - /** * Create array for recur record for pledge. * @return array diff --git a/CRM/Pledge/BAO/Query.php b/CRM/Pledge/BAO/Query.php index 960d67c29d..902872d1c1 100644 --- a/CRM/Pledge/BAO/Query.php +++ b/CRM/Pledge/BAO/Query.php @@ -31,6 +31,7 @@ * @copyright CiviCRM LLC (c) 2004-2019 */ class CRM_Pledge_BAO_Query extends CRM_Core_BAO_Query { + /** * Get pledge fields. * diff --git a/CRM/Pledge/Form/Payment.php b/CRM/Pledge/Form/Payment.php index d56b4907bf..ea24635c07 100644 --- a/CRM/Pledge/Form/Payment.php +++ b/CRM/Pledge/Form/Payment.php @@ -127,8 +127,7 @@ class CRM_Pledge_Form_Payment extends CRM_Core_Form { 'type' => 'cancel', 'name' => ts('Cancel'), ], - ] - ); + ]); } /** diff --git a/CRM/Pledge/Form/Pledge.php b/CRM/Pledge/Form/Pledge.php index 7f4710d9a2..e7478f8b13 100644 --- a/CRM/Pledge/Form/Pledge.php +++ b/CRM/Pledge/Form/Pledge.php @@ -53,16 +53,19 @@ class CRM_Pledge_Form_Pledge extends CRM_Core_Form { /** * The Pledge values if an existing pledge. + * @var array */ public $_values; /** * The Pledge frequency Units. + * @var array */ public $_freqUnits; /** * Is current pledge pending. + * @var bool */ public $_isPending = FALSE; @@ -119,7 +122,6 @@ class CRM_Pledge_Form_Pledge extends CRM_Core_Form { $this->_fromEmails = CRM_Core_BAO_Email::getFromEmail(); } - /** * Set default values for the form. * The default values are retrieved from the database. @@ -205,16 +207,15 @@ class CRM_Pledge_Form_Pledge extends CRM_Core_Form { 'type' => 'cancel', 'name' => ts('Cancel'), ], - ] - ); + ]); return; } if ($this->_context == 'standalone') { $this->addEntityRef('contact_id', ts('Contact'), [ - 'create' => TRUE, - 'api' => ['extra' => ['email']], - ], TRUE); + 'create' => TRUE, + 'api' => ['extra' => ['email']], + ], TRUE); } $showAdditionalInfo = FALSE; @@ -293,10 +294,11 @@ class CRM_Pledge_Form_Pledge extends CRM_Core_Form { $this->addRule('frequency_day', ts('Please enter a valid payment due day.'), 'positiveInteger'); $this->add('text', 'eachPaymentAmount', ts('each'), [ - 'size' => 10, - 'style' => "background-color:#EBECE4", - 0 => 'READONLY', // WTF, preserved because its inexplicable - ]); + 'size' => 10, + 'style' => "background-color:#EBECE4", + // WTF, preserved because its inexplicable + 0 => 'READONLY', + ]); // add various dates $createDate = $this->add('datepicker', 'create_date', ts('Pledge Made'), [], TRUE, ['time' => FALSE]); @@ -381,8 +383,7 @@ class CRM_Pledge_Form_Pledge extends CRM_Core_Form { 'type' => 'cancel', 'name' => ts('Cancel'), ], - ] - ); + ]); $this->addFormRule(['CRM_Pledge_Form_Pledge', 'formRule'], $this); @@ -565,9 +566,9 @@ class CRM_Pledge_Form_Pledge extends CRM_Core_Form { ); if (count($processors) > 0) { $statusMsg .= ' ' . ts("If a payment is due now, you can record a check, EFT, or cash payment for this pledge OR submit a credit card payment.", [ - 1 => $contribURL, - 2 => $creditURL, - ]); + 1 => $contribURL, + 2 => $creditURL, + ]); } else { $statusMsg .= ' ' . ts("If a payment is due now, you can record a check, EFT, or cash payment for this pledge.", [1 => $contribURL]); diff --git a/CRM/Pledge/Form/PledgeView.php b/CRM/Pledge/Form/PledgeView.php index 3120a7488d..0509c6bd40 100644 --- a/CRM/Pledge/Form/PledgeView.php +++ b/CRM/Pledge/Form/PledgeView.php @@ -136,8 +136,7 @@ class CRM_Pledge_Form_PledgeView extends CRM_Core_Form { 'spacing' => '         ', 'isDefault' => TRUE, ], - ] - ); + ]); } } diff --git a/CRM/Pledge/Form/Search.php b/CRM/Pledge/Form/Search.php index 3f9bb872ef..e4a0354e01 100644 --- a/CRM/Pledge/Form/Search.php +++ b/CRM/Pledge/Form/Search.php @@ -59,6 +59,7 @@ class CRM_Pledge_Form_Search extends CRM_Core_Form_Search { /** * Prefix for the controller. + * @var string */ protected $_prefix = "pledge_"; diff --git a/CRM/Pledge/Form/Task.php b/CRM/Pledge/Form/Task.php index c6716dff0d..ede0eb0caa 100644 --- a/CRM/Pledge/Form/Task.php +++ b/CRM/Pledge/Form/Task.php @@ -140,8 +140,7 @@ class CRM_Pledge_Form_Task extends CRM_Core_Form_Task { 'type' => $backType, 'name' => ts('Cancel'), ], - ] - ); + ]); } } diff --git a/CRM/Pledge/Form/Task/Print.php b/CRM/Pledge/Form/Task/Print.php index 3b5cb4357f..5af5df8d0b 100644 --- a/CRM/Pledge/Form/Task/Print.php +++ b/CRM/Pledge/Form/Task/Print.php @@ -80,8 +80,7 @@ class CRM_Pledge_Form_Task_Print extends CRM_Pledge_Form_Task { 'type' => 'back', 'name' => ts('Done'), ], - ] - ); + ]); } /** diff --git a/CRM/Pledge/Form/Task/Result.php b/CRM/Pledge/Form/Task/Result.php index 4a4994bfa0..385a151fa0 100644 --- a/CRM/Pledge/Form/Task/Result.php +++ b/CRM/Pledge/Form/Task/Result.php @@ -52,8 +52,7 @@ class CRM_Pledge_Form_Task_Result extends CRM_Pledge_Form_Task { 'name' => ts('Done'), 'isDefault' => TRUE, ], - ] - ); + ]); } } diff --git a/CRM/Pledge/Form/Task/SearchTaskHookSample.php b/CRM/Pledge/Form/Task/SearchTaskHookSample.php index 255a0e4b3a..0c8576ece9 100644 --- a/CRM/Pledge/Form/Task/SearchTaskHookSample.php +++ b/CRM/Pledge/Form/Task/SearchTaskHookSample.php @@ -75,8 +75,7 @@ INNER JOIN civicrm_contact ct ON ( plg.contact_id = ct.id ) 'name' => ts('Done'), 'isDefault' => TRUE, ], - ] - ); + ]); } } diff --git a/CRM/Pledge/Info.php b/CRM/Pledge/Info.php index d920df827e..3bbac1648b 100644 --- a/CRM/Pledge/Info.php +++ b/CRM/Pledge/Info.php @@ -36,6 +36,7 @@ class CRM_Pledge_Info extends CRM_Core_Component_Info { /** + * @var string * @inheritDoc */ protected $keyword = 'pledge'; @@ -58,7 +59,6 @@ class CRM_Pledge_Info extends CRM_Core_Component_Info { ]; } - /** * @inheritDoc * Provides permissions that are used by component. diff --git a/CRM/Pledge/Selector/Search.php b/CRM/Pledge/Selector/Search.php index 5c87aae324..94551d9544 100644 --- a/CRM/Pledge/Selector/Search.php +++ b/CRM/Pledge/Selector/Search.php @@ -43,21 +43,21 @@ class CRM_Pledge_Selector_Search extends CRM_Core_Selector_Base { * * @var array */ - static $_links = NULL; + public static $_links = NULL; /** * We use desc to remind us what that column is, name is used in the tpl * * @var array */ - static $_columnHeaders; + public static $_columnHeaders; /** * Properties of contact we're interested in displaying * * @var array */ - static $_properties = [ + public static $_properties = [ 'contact_id', 'sort_name', 'display_name', diff --git a/CRM/Pledge/Task.php b/CRM/Pledge/Task.php index 7becb5a000..39309019b6 100644 --- a/CRM/Pledge/Task.php +++ b/CRM/Pledge/Task.php @@ -36,7 +36,7 @@ */ class CRM_Pledge_Task extends CRM_Core_Task { - static $objectType = 'pledge'; + public static $objectType = 'pledge'; /** * These tasks are the core set of tasks that the user can perform diff --git a/CRM/Profile/Form.php b/CRM/Profile/Form.php index 647e86ae9c..4c110de5d4 100644 --- a/CRM/Profile/Form.php +++ b/CRM/Profile/Form.php @@ -79,7 +79,7 @@ class CRM_Profile_Form extends CRM_Core_Form { /** * Name of button for saving matching contacts. - * @var + * @var string */ protected $_duplicateButtonName; /** @@ -113,6 +113,7 @@ class CRM_Profile_Form extends CRM_Core_Form { /** * Dedupe using a specific rule (CRM-6131). * Not currently exposed in profile settings, but can be set in a buildForm hook. + * @var int */ public $_ruleGroupID = NULL; @@ -137,6 +138,7 @@ class CRM_Profile_Form extends CRM_Core_Form { /** * Store profile ids if multiple profile ids are passed using comma separated. * Currently lets implement this functionality only for dialog mode. + * @var array */ protected $_profileIds = []; diff --git a/CRM/Profile/Page/Dynamic.php b/CRM/Profile/Page/Dynamic.php index a373d15147..8f9d42e64c 100644 --- a/CRM/Profile/Page/Dynamic.php +++ b/CRM/Profile/Page/Dynamic.php @@ -72,6 +72,7 @@ class CRM_Profile_Page_Dynamic extends CRM_Core_Page { /** * Store profile ids if multiple profile ids are passed using comma separated. * Currently lets implement this functionality only for dialog mode + * @var array */ protected $_profileIds = []; @@ -93,8 +94,10 @@ class CRM_Profile_Page_Dynamic extends CRM_Core_Page { protected $_recordId = NULL; - /* + /** + * * fetch multirecord as well as non-multirecord fields + * @var int */ protected $_allFields = NULL; diff --git a/CRM/Profile/Page/Listings.php b/CRM/Profile/Page/Listings.php index d5e3c4a116..0fdc3a2d1e 100644 --- a/CRM/Profile/Page/Listings.php +++ b/CRM/Profile/Page/Listings.php @@ -84,6 +84,7 @@ class CRM_Profile_Page_Listings extends CRM_Core_Page { /** * Store profile ids if multiple profile ids are passed using comma separated. * Currently lets implement this functionality only for dialog mode + * @var array */ protected $_profileIds = []; diff --git a/CRM/Profile/Page/MultipleRecordFieldsListing.php b/CRM/Profile/Page/MultipleRecordFieldsListing.php index 6d50d65b20..66bc8ed9eb 100644 --- a/CRM/Profile/Page/MultipleRecordFieldsListing.php +++ b/CRM/Profile/Page/MultipleRecordFieldsListing.php @@ -38,7 +38,7 @@ class CRM_Profile_Page_MultipleRecordFieldsListing extends CRM_Core_Page_Basic { * * @var array */ - static $_links = NULL; + public static $_links = NULL; protected $_fields = NULL; diff --git a/CRM/Profile/Selector/Listings.php b/CRM/Profile/Selector/Listings.php index 4d5a2034de..ac36108f2a 100644 --- a/CRM/Profile/Selector/Listings.php +++ b/CRM/Profile/Selector/Listings.php @@ -44,14 +44,14 @@ class CRM_Profile_Selector_Listings extends CRM_Core_Selector_Base implements CR * * @var array */ - static $_links = NULL; + public static $_links = NULL; /** * We use desc to remind us what that column is, name is used in the tpl * * @var array */ - static $_columnHeaders; + public static $_columnHeaders; /** * The sql params we use to get the list of contacts. @@ -119,6 +119,7 @@ class CRM_Profile_Selector_Listings extends CRM_Core_Selector_Base implements CR /** * Store profile ids if multiple profile ids are passed using comma separated. * Currently lets implement this functionality only for dialog mode + * @var array */ protected $_profileIds = []; diff --git a/CRM/Queue/ErrorPolicy.php b/CRM/Queue/ErrorPolicy.php index f87c5df773..600b45d25a 100644 --- a/CRM/Queue/ErrorPolicy.php +++ b/CRM/Queue/ErrorPolicy.php @@ -63,10 +63,10 @@ class CRM_Queue_ErrorPolicy { $this->active = TRUE; $this->backup = []; foreach ([ - 'display_errors', - 'html_errors', - 'xmlrpc_errors', - ] as $key) { + 'display_errors', + 'html_errors', + 'xmlrpc_errors', + ] as $key) { $this->backup[$key] = ini_get($key); ini_set($key, 0); } @@ -82,10 +82,10 @@ class CRM_Queue_ErrorPolicy { $this->errorScope = NULL; restore_error_handler(); foreach ([ - 'display_errors', - 'html_errors', - 'xmlrpc_errors', - ] as $key) { + 'display_errors', + 'html_errors', + 'xmlrpc_errors', + ] as $key) { ini_set($key, $this->backup[$key]); } $this->active = FALSE; diff --git a/CRM/Queue/Queue.php b/CRM/Queue/Queue.php index d8c7df0848..6057668ddc 100644 --- a/CRM/Queue/Queue.php +++ b/CRM/Queue/Queue.php @@ -71,24 +71,24 @@ abstract class CRM_Queue_Queue { /** * Perform any registation or resource-allocation for a new queue */ - public abstract function createQueue(); + abstract public function createQueue(); /** * Perform any loading or pre-fetch for an existing queue. */ - public abstract function loadQueue(); + abstract public function loadQueue(); /** * Release any resources claimed by the queue (memory, DB rows, etc) */ - public abstract function deleteQueue(); + abstract public function deleteQueue(); /** * Check if the queue exists. * * @return bool */ - public abstract function existsQueue(); + abstract public function existsQueue(); /** * Add a new item to the queue. @@ -99,14 +99,14 @@ abstract class CRM_Queue_Queue { * Queue-dependent options; for example, if this is a * priority-queue, then $options might specify the item's priority. */ - public abstract function createItem($data, $options = []); + abstract public function createItem($data, $options = []); /** * Determine number of items remaining in the queue. * * @return int */ - public abstract function numberOfItems(); + abstract public function numberOfItems(); /** * Get the next item. @@ -117,7 +117,7 @@ abstract class CRM_Queue_Queue { * @return object * with key 'data' that matches the inputted data */ - public abstract function claimItem($lease_time = 3600); + abstract public function claimItem($lease_time = 3600); /** * Get the next item, even if there's an active lease @@ -128,7 +128,7 @@ abstract class CRM_Queue_Queue { * @return object * with key 'data' that matches the inputted data */ - public abstract function stealItem($lease_time = 3600); + abstract public function stealItem($lease_time = 3600); /** * Remove an item from the queue. @@ -136,7 +136,7 @@ abstract class CRM_Queue_Queue { * @param object $item * The item returned by claimItem. */ - public abstract function deleteItem($item); + abstract public function deleteItem($item); /** * Return an item that could not be processed. @@ -144,6 +144,6 @@ abstract class CRM_Queue_Queue { * @param object $item * The item returned by claimItem. */ - public abstract function releaseItem($item); + abstract public function releaseItem($item); } diff --git a/CRM/Queue/Runner.php b/CRM/Queue/Runner.php index 837a77f8d8..fa2817e713 100644 --- a/CRM/Queue/Runner.php +++ b/CRM/Queue/Runner.php @@ -59,7 +59,10 @@ class CRM_Queue_Runner { public $onEnd; public $onEndUrl; public $pathPrefix; - // queue-runner id; used for persistence + /** + * queue-runner id; used for persistence + * @var int + */ public $qrid; /** diff --git a/CRM/Report/DAO/ReportInstance.php b/CRM/Report/DAO/ReportInstance.php index 48a6a02296..c07fa67bca 100644 --- a/CRM/Report/DAO/ReportInstance.php +++ b/CRM/Report/DAO/ReportInstance.php @@ -19,14 +19,14 @@ class CRM_Report_DAO_ReportInstance extends CRM_Core_DAO { * * @var string */ - static $_tableName = 'civicrm_report_instance'; + public static $_tableName = 'civicrm_report_instance'; /** * Should CiviCRM log any modifications to this table in the civicrm_log table. * * @var bool */ - static $_log = FALSE; + public static $_log = FALSE; /** * Report Instance ID diff --git a/CRM/Report/Form.php b/CRM/Report/Form.php index 389e7769db..a136d9ef6c 100644 --- a/CRM/Report/Form.php +++ b/CRM/Report/Form.php @@ -93,6 +93,7 @@ class CRM_Report_Form extends CRM_Core_Form { /** * By default most reports hide contact id. * Setting this to true makes it available + * @var bool */ protected $_exposeContactID = TRUE; @@ -137,11 +138,13 @@ class CRM_Report_Form extends CRM_Core_Form { /** * Build tags filter + * @var bool */ protected $_tagFilter = FALSE; /** * specify entity table for tags filter + * @var string */ protected $_tagFilterTable = 'civicrm_contact'; @@ -322,6 +325,7 @@ class CRM_Report_Form extends CRM_Core_Form { /** * Variables to hold the acl inner join and where clause + * @var string|NULL */ protected $_aclFrom = NULL; protected $_aclWhere = NULL; @@ -354,7 +358,7 @@ class CRM_Report_Form extends CRM_Core_Form { * * (it's unclear if this could be merged with outputMode at this stage) * - * @var + * @var string|NULL */ protected $_format; @@ -390,6 +394,7 @@ class CRM_Report_Form extends CRM_Core_Form { /** * Variable to hold the currency alias + * @var string|NULL */ protected $_currencyColumn = NULL; @@ -448,6 +453,7 @@ class CRM_Report_Form extends CRM_Core_Form { * When a grand total row has calculated the status we pop it off to here. * * This allows us to access it from the stats function and avoid recalculating. + * @var array */ protected $rollupRow = []; @@ -501,6 +507,7 @@ class CRM_Report_Form extends CRM_Core_Form { * @var bool */ public $optimisedForOnlyFullGroupBy = TRUE; + /** * Class constructor. */ @@ -1611,8 +1618,7 @@ class CRM_Report_Form extends CRM_Core_Form { 'name' => $showResultsLabel, 'isDefault' => TRUE, ], - ] - ); + ]); } /** @@ -3510,7 +3516,6 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND CRM_Utils_Array::value('report_footer', $this->_formValues); } - /** * Post process function. */ @@ -3703,7 +3708,6 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND return "1"; } - /** * Create a table of the contact ids included by the group filter. * @@ -4137,13 +4141,13 @@ LEFT JOIN civicrm_contact {$field['alias']} ON {$field['alias']}.id = {$this->_a if (!empty($prop['filters']) && $this->_customGroupFilters) { foreach ($prop['filters'] as $fieldAlias => $val) { foreach ([ - 'value', - 'min', - 'max', - 'relative', - 'from', - 'to', - ] as $attach) { + 'value', + 'min', + 'max', + 'relative', + 'from', + 'to', + ] as $attach) { if (isset($this->_params[$fieldAlias . '_' . $attach]) && (!empty($this->_params[$fieldAlias . '_' . $attach]) || ($attach != 'relative' && @@ -4295,7 +4299,7 @@ LEFT JOIN civicrm_contact {$field['alias']} ON {$field['alias']}.id = {$this->_a /** * Add campaign fields. - * + * @param string $entityTable * @param bool $groupBy * Add GroupBy? Not appropriate for detail report. * @param bool $orderBy diff --git a/CRM/Report/Form/Campaign/SurveyDetails.php b/CRM/Report/Form/Campaign/SurveyDetails.php index d84c14fd33..e8b7f84b47 100644 --- a/CRM/Report/Form/Campaign/SurveyDetails.php +++ b/CRM/Report/Form/Campaign/SurveyDetails.php @@ -54,11 +54,15 @@ class CRM_Report_Form_Campaign_SurveyDetails extends CRM_Report_Form { private static $_surveyRespondentStatus; // Survey Question titles are overridden when in print or pdf mode to - // say Q1, Q2 instead of the full title - to save space. + /** + * say Q1, Q2 instead of the full title - to save space. + * @var array + */ private $_columnTitleOverrides = array(); /** */ + /** */ public function __construct() { @@ -704,12 +708,11 @@ INNER JOIN civicrm_custom_group cg ON ( cg.id = cf.custom_group_id ) 'alias' => "phone_civireport_{$fName}", 'fields' => array( $fName => array_merge($value, array( - 'is_required' => '1', - 'alias' => "phone_civireport_{$fName}", - 'dbAlias' => "phone_civireport_{$fName}.phone", - 'no_display' => TRUE, - ) - ), + 'is_required' => '1', + 'alias' => "phone_civireport_{$fName}", + 'dbAlias' => "phone_civireport_{$fName}.phone", + 'no_display' => TRUE, + )), ), ); $this->_aliases["civicrm_phone_{$fName}"] = $this->_columns["civicrm_{$fName}"]['alias']; diff --git a/CRM/Report/Form/Case/Detail.php b/CRM/Report/Form/Case/Detail.php index 0a38995fcb..0c5bcffea3 100644 --- a/CRM/Report/Form/Case/Detail.php +++ b/CRM/Report/Form/Case/Detail.php @@ -150,7 +150,8 @@ class CRM_Report_Form_Case_Detail extends CRM_Report_Form { 'case_type_title' => [ 'title' => 'Case Type', 'name' => 'title', - ]] + ], + ], ], 'civicrm_contact' => [ 'dao' => 'CRM_Contact_DAO_Contact', diff --git a/CRM/Report/Form/Contact/LoggingDetail.php b/CRM/Report/Form/Contact/LoggingDetail.php index d65cb97d49..aa0acc3256 100644 --- a/CRM/Report/Form/Contact/LoggingDetail.php +++ b/CRM/Report/Form/Contact/LoggingDetail.php @@ -33,6 +33,7 @@ * */ class CRM_Report_Form_Contact_LoggingDetail extends CRM_Logging_ReportDetail { + /** */ public function __construct() { diff --git a/CRM/Report/Form/Contact/LoggingSummary.php b/CRM/Report/Form/Contact/LoggingSummary.php index 61d255fdc9..97ebefc94b 100644 --- a/CRM/Report/Form/Contact/LoggingSummary.php +++ b/CRM/Report/Form/Contact/LoggingSummary.php @@ -33,6 +33,7 @@ class CRM_Report_Form_Contact_LoggingSummary extends CRM_Logging_ReportSummary { public $optimisedForOnlyFullGroupBy = FALSE; + /** * Class constructor. */ diff --git a/CRM/Report/Form/Contribute/Bookkeeping.php b/CRM/Report/Form/Contribute/Bookkeeping.php index 753844af98..adceb9a0cb 100644 --- a/CRM/Report/Form/Contribute/Bookkeeping.php +++ b/CRM/Report/Form/Contribute/Bookkeeping.php @@ -538,11 +538,10 @@ class CRM_Report_Form_Contribute_Bookkeeping extends CRM_Report_Form { foreach ($table['filters'] as $fieldName => $field) { $clause = NULL; if (in_array($fieldName, [ - 'credit_accounting_code', - 'credit_name', - 'credit_contact_id', - ] - )) { + 'credit_accounting_code', + 'credit_name', + 'credit_contact_id', + ])) { $field['dbAlias'] = "CASE WHEN financial_trxn_civireport.from_financial_account_id IS NOT NULL THEN financial_account_civireport_credit_1.{$field['name']} diff --git a/CRM/Report/Form/Contribute/DeferredRevenue.php b/CRM/Report/Form/Contribute/DeferredRevenue.php index 837a417c3a..321c5378e3 100644 --- a/CRM/Report/Form/Contribute/DeferredRevenue.php +++ b/CRM/Report/Form/Contribute/DeferredRevenue.php @@ -36,6 +36,7 @@ class CRM_Report_Form_Contribute_DeferredRevenue extends CRM_Report_Form { /** * Holds Deferred Financial Account + * @var array */ protected $_deferredFinancialAccount = []; diff --git a/CRM/Report/Form/Contribute/History.php b/CRM/Report/Form/Contribute/History.php index 89b0dfe4b9..584bd347da 100644 --- a/CRM/Report/Form/Contribute/History.php +++ b/CRM/Report/Form/Contribute/History.php @@ -31,8 +31,13 @@ * @copyright CiviCRM LLC (c) 2004-2019 */ class CRM_Report_Form_Contribute_History extends CRM_Report_Form { - // Primary Contacts count limitCONSTROW_COUNT_LIMIT = 10; + /** + * Primary Contacts count limitCONSTROW_COUNT_LIMIT = 10; + */ + /** + * @var array + */ protected $_relationshipColumns = []; protected $_customGroupExtends = [ diff --git a/CRM/Report/Form/Contribute/Lybunt.php b/CRM/Report/Form/Contribute/Lybunt.php index 3b1ed480be..f3972d42f5 100644 --- a/CRM/Report/Form/Contribute/Lybunt.php +++ b/CRM/Report/Form/Contribute/Lybunt.php @@ -284,7 +284,7 @@ class CRM_Report_Form_Contribute_Lybunt extends CRM_Report_Form { $this->_columnHeaders["{$tableName}_{$fieldName}"] = $field; $this->_columnHeaders["{$tableName}_{$fieldName}"]['title'] = $this->getLastYearColumnTitle(); $this->_statFields[$this->getLastYearColumnTitle()] = "{$tableName}_{$fieldName}"; - return "SUM(IF(" . $this->whereClauseLastYear('contribution_civireport.receive_date') . ", contribution_civireport.total_amount, 0)) as {$tableName}_{$fieldName}"; + return "SUM(IF(" . $this->whereClauseLastYear('contribution_civireport.receive_date') . ", contribution_civireport.total_amount, 0)) as {$tableName}_{$fieldName}"; } if ($fieldName == 'civicrm_life_time_total') { $this->_columnHeaders["{$tableName}_{$fieldName}"] = $field; @@ -420,7 +420,6 @@ class CRM_Report_Form_Contribute_Lybunt extends CRM_Report_Form { return "$fieldName BETWEEN '" . $this->getFirstDateOfCurrentRange() . "' AND '" . $this->getLastDateOfCurrentRange() . "'"; } - /** * Get the year value for the current year. * @@ -482,7 +481,6 @@ class CRM_Report_Form_Contribute_Lybunt extends CRM_Report_Form { return date('YmdHis', strtotime('+ 1 year - 1 second', strtotime($this->getFirstDateOfPriorRange()))); } - public function groupBy() { $this->_groupBy = "GROUP BY {$this->_aliases['civicrm_contribution']}.contact_id "; $this->_select = CRM_Contact_BAO_Query::appendAnyValueToSelect($this->_selectClauses, "{$this->_aliases['civicrm_contribution']}.contact_id"); @@ -518,7 +516,7 @@ class CRM_Report_Form_Contribute_Lybunt extends CRM_Report_Form { } else { $select = "SELECT SUM({$this->_aliases['civicrm_contribution']}.total_amount) as amount, - SUM(IF( " . $this->whereClauseLastYear('contribution_civireport.receive_date') . ", contribution_civireport.total_amount, 0)) as last_year + SUM(IF( " . $this->whereClauseLastYear('contribution_civireport.receive_date') . ", contribution_civireport.total_amount, 0)) as last_year "; $sql = "{$select} {$this->_from} {$this->_where}"; $dao = CRM_Core_DAO::executeQuery($sql); diff --git a/CRM/Report/Form/Contribute/Recur.php b/CRM/Report/Form/Contribute/Recur.php index e3f733f059..240ad47e72 100644 --- a/CRM/Report/Form/Contribute/Recur.php +++ b/CRM/Report/Form/Contribute/Recur.php @@ -362,7 +362,6 @@ class CRM_Report_Form_Contribute_Recur extends CRM_Report_Form { } } - /** * Alter display of rows. * diff --git a/CRM/Report/Form/Contribute/RecurSummary.php b/CRM/Report/Form/Contribute/RecurSummary.php index af66c0dc68..94188df828 100644 --- a/CRM/Report/Form/Contribute/RecurSummary.php +++ b/CRM/Report/Form/Contribute/RecurSummary.php @@ -33,6 +33,7 @@ * */ class CRM_Report_Form_Contribute_RecurSummary extends CRM_Report_Form { + /** */ public function __construct() { diff --git a/CRM/Report/Form/Contribute/Repeat.php b/CRM/Report/Form/Contribute/Repeat.php index 142c7eb403..177c6a7a0c 100644 --- a/CRM/Report/Form/Contribute/Repeat.php +++ b/CRM/Report/Form/Contribute/Repeat.php @@ -78,7 +78,7 @@ class CRM_Report_Form_Contribute_Repeat extends CRM_Report_Form { /** * The column in the contribution table that joins to the temp tables. * - * @var + * @var string */ protected $contributionJoinTableColumn; diff --git a/CRM/Report/Form/Contribute/Summary.php b/CRM/Report/Form/Contribute/Summary.php index 6e4b238d6f..05d72b807f 100644 --- a/CRM/Report/Form/Contribute/Summary.php +++ b/CRM/Report/Form/Contribute/Summary.php @@ -442,10 +442,10 @@ class CRM_Report_Form_Contribute_Summary extends CRM_Report_Form { if (empty($fields['fields']['total_amount'])) { foreach (array( - 'total_count_value', - 'total_sum_value', - 'total_avg_value', - ) as $val) { + 'total_count_value', + 'total_sum_value', + 'total_avg_value', + ) as $val) { if (!empty($fields[$val])) { $errors[$val] = ts("Please select the Amount Statistics"); } @@ -745,7 +745,8 @@ ROUND(AVG({$this->_aliases['civicrm_contribution_soft']}.amount), 2) as civicrm_ $contriFields = array( 'civicrm_contribution_total_amount_sum', 'civicrm_contribution_total_amount_avg', - 'civicrm_contribution_total_amount_count'); + 'civicrm_contribution_total_amount_count', + ); $contriRows = array(); while ($contriDAO->fetch()) { $contriRow = array(); diff --git a/CRM/Report/Form/Event/ParticipantListing.php b/CRM/Report/Form/Event/ParticipantListing.php index 5524f1bb50..018be0cf2d 100644 --- a/CRM/Report/Form/Event/ParticipantListing.php +++ b/CRM/Report/Form/Event/ParticipantListing.php @@ -66,7 +66,8 @@ class CRM_Report_Form_Event_ParticipantListing extends CRM_Report_Form { 'required' => TRUE, 'no_repeat' => TRUE, 'dbAlias' => 'contact_civireport.sort_name', - )), + ), + ), $this->getBasicContactFields(), array( 'age_at_event' => array( diff --git a/CRM/Report/Form/Extended.php b/CRM/Report/Form/Extended.php index 9e04ef659b..873665e8cd 100644 --- a/CRM/Report/Form/Extended.php +++ b/CRM/Report/Form/Extended.php @@ -63,7 +63,6 @@ class CRM_Report_Form_Extended extends CRM_Report_Form { parent::select(); } - /** * From clause build where baseTable & fromClauses are defined */ @@ -252,7 +251,8 @@ class CRM_Report_Form_Extended extends CRM_Report_Form { 'title' => ts('Price Field Value Label'), ], ], - 'group_bys' => //note that we have a requirement to group by label such that all 'Promo book' lines + //note that we have a requirement to group by label such that all 'Promo book' lines + 'group_bys' => // are grouped together across price sets but there may be a separate need to group // by id so that entries in one price set are distinct from others. Not quite sure what // to call the distinction for end users benefit diff --git a/CRM/Report/Form/Instance.php b/CRM/Report/Form/Instance.php index ec2d76e2dc..792948c036 100644 --- a/CRM/Report/Form/Instance.php +++ b/CRM/Report/Form/Instance.php @@ -173,8 +173,7 @@ class CRM_Report_Form_Instance { 'type' => 'cancel', 'name' => ts('Cancel'), ], - ] - ); + ]); $form->addFormRule(['CRM_Report_Form_Instance', 'formRule'], $form); } diff --git a/CRM/Report/Form/Mailing/Summary.php b/CRM/Report/Form/Mailing/Summary.php index ba6acbee02..549eaf7cda 100644 --- a/CRM/Report/Form/Mailing/Summary.php +++ b/CRM/Report/Form/Mailing/Summary.php @@ -557,9 +557,9 @@ class CRM_Report_Form_Mailing_Summary extends CRM_Report_Form { if ($isError) { $errors['_qf_default'] = ts('For Chart view, please select at least one field from %1 OR %2.', [ - 1 => implode(', ', $criteria['count']), - 2 => implode(', ', $criteria['rate']), - ]); + 1 => implode(', ', $criteria['count']), + 2 => implode(', ', $criteria['rate']), + ]); } return $errors; diff --git a/CRM/Report/Form/Membership/Summary.php b/CRM/Report/Form/Membership/Summary.php index 34c3a77e3b..1a25d45603 100644 --- a/CRM/Report/Form/Membership/Summary.php +++ b/CRM/Report/Form/Membership/Summary.php @@ -334,10 +334,10 @@ LEFT JOIN civicrm_contribution {$this->_aliases['civicrm_contribution']} if (!empty($this->_params['charts'])) { foreach ([ - 'receive_date', - $this->_interval, - 'value', - ] as $ignore) { + 'receive_date', + $this->_interval, + 'value', + ] as $ignore) { unset($graphRows[$ignore][$count - 1]); } diff --git a/CRM/Report/Form/Pledge/Detail.php b/CRM/Report/Form/Pledge/Detail.php index b29c729bad..2774198c13 100644 --- a/CRM/Report/Form/Pledge/Detail.php +++ b/CRM/Report/Form/Pledge/Detail.php @@ -219,7 +219,8 @@ class CRM_Report_Form_Pledge_Detail extends CRM_Report_Form { */ public function selectClause(&$tableName, $tableKey, &$fieldName, &$field) { if ($fieldName == 'total_paid') { - $this->_totalPaid = TRUE; // add pledge_payment join + // add pledge_payment join + $this->_totalPaid = TRUE; $this->_columnHeaders["{$tableName}_{$fieldName}"] = [ 'title' => $field['title'], 'type' => $field['type'], @@ -229,7 +230,8 @@ class CRM_Report_Form_Pledge_Detail extends CRM_Report_Form { if ($fieldName == 'balance_due') { $cancelledStatus = array_search('Cancelled', $this->_pledgeStatuses); $completedStatus = array_search('Completed', $this->_pledgeStatuses); - $this->_totalPaid = TRUE; // add pledge_payment join + // add pledge_payment join + $this->_totalPaid = TRUE; $this->_columnHeaders["{$tableName}_{$fieldName}"] = $field['title']; $this->_columnHeaders["{$tableName}_{$fieldName}"] = [ 'title' => $field['title'], diff --git a/CRM/Report/Form/Pledge/Pbnp.php b/CRM/Report/Form/Pledge/Pbnp.php index e796cac5fe..17369bf19a 100644 --- a/CRM/Report/Form/Pledge/Pbnp.php +++ b/CRM/Report/Form/Pledge/Pbnp.php @@ -213,10 +213,10 @@ class CRM_Report_Form_Pledge_Pbnp extends CRM_Report_Form { $allStatus = CRM_Contribute_PseudoConstant::contributionStatus(NULL, 'name'); $pendingStatus = array_search('Pending', $allStatus); foreach ([ - 'Pending', - 'In Progress', - 'Overdue', - ] as $statusKey) { + 'Pending', + 'In Progress', + 'Overdue', + ] as $statusKey) { if ($key = CRM_Utils_Array::key($statusKey, $allStatus)) { $unpaidStatus[] = $key; } diff --git a/CRM/Report/Form/Register.php b/CRM/Report/Form/Register.php index c99ac77738..469b984435 100644 --- a/CRM/Report/Form/Register.php +++ b/CRM/Report/Form/Register.php @@ -93,8 +93,7 @@ class CRM_Report_Form_Register extends CRM_Core_Form { 'type' => 'cancel', 'name' => ts('Cancel'), ], - ] - ); + ]); return; } @@ -128,8 +127,7 @@ class CRM_Report_Form_Register extends CRM_Core_Form { 'type' => 'cancel', 'name' => ts('Cancel'), ], - ] - ); + ]); $this->addFormRule(['CRM_Report_Form_Register', 'formRule'], $this); } @@ -193,9 +191,9 @@ class CRM_Report_Form_Register extends CRM_Core_Form { $optionValue = CRM_Core_OptionValue::addOptionValue($params, 'report_template', $this->_action, $this->_id); CRM_Core_Session::setStatus(ts('The %1 \'%2\' has been saved.', [ - 1 => 'Report Template', - 2 => $optionValue->label, - ]), ts('Saved'), 'success'); + 1 => 'Report Template', + 2 => $optionValue->label, + ]), ts('Saved'), 'success'); CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/admin/report/options/report_template', "reset=1")); } } diff --git a/CRM/Report/Info.php b/CRM/Report/Info.php index 5cd505292f..7ba155628f 100644 --- a/CRM/Report/Info.php +++ b/CRM/Report/Info.php @@ -37,6 +37,7 @@ class CRM_Report_Info extends CRM_Core_Component_Info { /** + * @var string * @inheritDoc */ protected $keyword = 'report'; @@ -60,7 +61,6 @@ class CRM_Report_Info extends CRM_Core_Component_Info { ]; } - /** * @inheritDoc * Provides permissions that are used by component. @@ -118,7 +118,6 @@ class CRM_Report_Info extends CRM_Core_Component_Info { return $permissions; } - /** * @inheritDoc * Provides information about user dashboard element @@ -139,6 +138,7 @@ class CRM_Report_Info extends CRM_Core_Component_Info { * @return mixed * component's User Dashboard applet object */ + /** * @return mixed */ @@ -156,6 +156,7 @@ class CRM_Report_Info extends CRM_Core_Component_Info { * collection of required dashboard settings, * null if no element offered */ + /** * @return array|null */ @@ -181,6 +182,7 @@ class CRM_Report_Info extends CRM_Core_Component_Info { * collection of required pane settings, * null if no element offered */ + /** * @return array|null */ @@ -199,6 +201,7 @@ class CRM_Report_Info extends CRM_Core_Component_Info { * @return array|null * collection of activity types */ + /** * @return array|null */ diff --git a/CRM/Report/Page/Instance.php b/CRM/Report/Page/Instance.php index c101c06b18..9d9c781302 100644 --- a/CRM/Report/Page/Instance.php +++ b/CRM/Report/Page/Instance.php @@ -35,6 +35,7 @@ * Page for invoking report instances */ class CRM_Report_Page_Instance extends CRM_Core_Page { + /** * Run this page (figure out the action needed and perform it). */ diff --git a/CRM/Report/Page/InstanceList.php b/CRM/Report/Page/InstanceList.php index e623e77a5d..8e8b17cbdd 100644 --- a/CRM/Report/Page/InstanceList.php +++ b/CRM/Report/Page/InstanceList.php @@ -36,9 +36,9 @@ */ class CRM_Report_Page_InstanceList extends CRM_Core_Page { - static $_links = NULL; + public static $_links = NULL; - static $_exceptions = ['logging/contact/detail']; + public static $_exceptions = ['logging/contact/detail']; /** * Name of component if report list is filtered. @@ -208,7 +208,7 @@ class CRM_Report_Page_InstanceList extends CRM_Core_Page { $rows = $this->info(); $this->assign('list', $rows); - if ($this->ovID OR $this->compID) { + if ($this->ovID or $this->compID) { // link to view all reports $reportUrl = CRM_Utils_System::url('civicrm/report/list', "reset=1"); $this->assign('reportUrl', $reportUrl); diff --git a/CRM/Report/Page/Options.php b/CRM/Report/Page/Options.php index 65374992f1..c4e5a1378a 100644 --- a/CRM/Report/Page/Options.php +++ b/CRM/Report/Page/Options.php @@ -43,28 +43,28 @@ class CRM_Report_Page_Options extends CRM_Core_Page_Basic { * * @var array */ - static $_links = NULL; + public static $_links = NULL; /** * The option group name. * * @var array */ - static $_gName = NULL; + public static $_gName = NULL; /** * The option group name in display format (capitalized, without underscores...etc) * * @var array */ - static $_GName = NULL; + public static $_GName = NULL; /** * The option group id. * * @var array */ - static $_gId = NULL; + public static $_gId = NULL; /** * Obtains the group name from url and sets the title. -- 2.25.1