From 971e129ba60ff4699184047a1df9aa5daf678098 Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Mon, 8 Apr 2019 07:45:09 +1000 Subject: [PATCH] (NFC) Update CRM/Member CRM/Note CRM/Logging CRM/Import and CRM/Price folders to be a future coder standard --- CRM/Import/DataSource/CSV.php | 6 +++--- CRM/Import/Form/DataSource.php | 3 +-- CRM/Import/Form/Preview.php | 4 ++-- CRM/Import/Form/Summary.php | 3 +-- CRM/Import/Parser.php | 11 +++++++++++ CRM/Logging/ReportDetail.php | 6 ++++-- CRM/Logging/Reverter.php | 2 +- CRM/Member/ActionMapping.php | 1 - CRM/Member/BAO/Membership.php | 13 ++++++++----- CRM/Member/BAO/MembershipBlock.php | 1 + CRM/Member/BAO/MembershipPayment.php | 1 - CRM/Member/BAO/MembershipStatus.php | 3 ++- CRM/Member/BAO/MembershipType.php | 6 +++--- CRM/Member/BAO/Query.php | 3 ++- CRM/Member/Form.php | 2 +- CRM/Member/Form/Membership.php | 15 ++++++++++----- CRM/Member/Form/MembershipBlock.php | 1 + CRM/Member/Form/MembershipRenewal.php | 5 +++++ CRM/Member/Form/MembershipStatus.php | 2 +- CRM/Member/Form/MembershipView.php | 2 +- CRM/Member/Form/Search.php | 1 + CRM/Member/Form/Task/Batch.php | 2 ++ CRM/Member/Form/Task/PickProfile.php | 2 ++ CRM/Member/Import/Field.php | 5 ++++- CRM/Member/Import/Form/MapField.php | 3 +-- CRM/Member/Import/Parser.php | 8 +++++++- CRM/Member/Import/Parser/Membership.php | 2 +- CRM/Member/Info.php | 7 ++++++- CRM/Member/Page/MembershipStatus.php | 2 +- CRM/Member/Page/MembershipType.php | 2 +- CRM/Member/Page/Tab.php | 4 ++-- CRM/Member/PseudoConstant.php | 2 +- CRM/Member/Selector/Search.php | 6 +++--- CRM/Member/Task.php | 12 ++++++++---- CRM/Member/Tokens.php | 3 +-- CRM/Note/Form/Note.php | 5 ++--- CRM/Price/BAO/LineItem.php | 7 ++++--- CRM/Price/BAO/PriceField.php | 3 ++- CRM/Price/BAO/PriceSet.php | 3 +-- CRM/Price/Form/Field.php | 1 + CRM/Price/Page/Option.php | 12 ++++++------ 41 files changed, 115 insertions(+), 67 deletions(-) diff --git a/CRM/Import/DataSource/CSV.php b/CRM/Import/DataSource/CSV.php index d51acd5962..69108e3262 100644 --- a/CRM/Import/DataSource/CSV.php +++ b/CRM/Import/DataSource/CSV.php @@ -75,9 +75,9 @@ class CRM_Import_DataSource_CSV extends CRM_Import_DataSource { $form->add('File', 'uploadFile', ts('Import Data File'), 'size=30 maxlength=255', TRUE); $form->setMaxFileSize($uploadFileSize); $form->addRule('uploadFile', ts('File size should be less than %1 MBytes (%2 bytes)', [ - 1 => $uploadSize, - 2 => $uploadFileSize, - ]), 'maxfilesize', $uploadFileSize); + 1 => $uploadSize, + 2 => $uploadFileSize, + ]), 'maxfilesize', $uploadFileSize); $form->addRule('uploadFile', ts('Input file must be in CSV format'), 'utf8File'); $form->addRule('uploadFile', ts('A valid file must be uploaded.'), 'uploadedfile'); diff --git a/CRM/Import/Form/DataSource.php b/CRM/Import/Form/DataSource.php index bbce168434..ae577f0c51 100644 --- a/CRM/Import/Form/DataSource.php +++ b/CRM/Import/Form/DataSource.php @@ -103,8 +103,7 @@ abstract class CRM_Import_Form_DataSource extends CRM_Core_Form { 'type' => 'cancel', 'name' => ts('Cancel'), ], - ] - ); + ]); } /** diff --git a/CRM/Import/Form/Preview.php b/CRM/Import/Form/Preview.php index 4e9dcf71ce..88810af0ba 100644 --- a/CRM/Import/Form/Preview.php +++ b/CRM/Import/Form/Preview.php @@ -38,6 +38,7 @@ * those classes can be removed entirely and this class will not need to be abstract */ abstract class CRM_Import_Form_Preview extends CRM_Core_Form { + /** * Return a descriptive name for the page, used in wizard header. * @@ -66,8 +67,7 @@ abstract class CRM_Import_Form_Preview extends CRM_Core_Form { 'type' => 'cancel', 'name' => ts('Cancel'), ], - ] - ); + ]); } /** diff --git a/CRM/Import/Form/Summary.php b/CRM/Import/Form/Summary.php index 84f8d03593..f24de6ebb9 100644 --- a/CRM/Import/Form/Summary.php +++ b/CRM/Import/Form/Summary.php @@ -49,8 +49,7 @@ abstract class CRM_Import_Form_Summary extends CRM_Core_Form { 'name' => ts('Done'), 'isDefault' => TRUE, ), - ) - ); + )); } /** diff --git a/CRM/Import/Parser.php b/CRM/Import/Parser.php index 7062832309..cf01fdd054 100644 --- a/CRM/Import/Parser.php +++ b/CRM/Import/Parser.php @@ -59,16 +59,19 @@ abstract class CRM_Import_Parser { /** * Total number of non empty lines + * @var int */ protected $_totalCount; /** * Running total number of valid lines + * @var int */ protected $_validCount; /** * Running total number of invalid rows + * @var int */ protected $_invalidRowCount; @@ -81,41 +84,49 @@ abstract class CRM_Import_Parser { /** * Array of error lines, bounded by MAX_ERROR + * @var array */ protected $_errors; /** * Total number of conflict lines + * @var int */ protected $_conflictCount; /** * Array of conflict lines + * @var array */ protected $_conflicts; /** * Total number of duplicate (from database) lines + * @var int */ protected $_duplicateCount; /** * Array of duplicate lines + * @var array */ protected $_duplicates; /** * Running total number of warnings + * @var int */ protected $_warningCount; /** * Maximum number of warnings to store + * @var int */ protected $_maxWarningCount = self::MAX_WARNINGS; /** * Array of warning lines, bounded by MAX_WARNING + * @var array */ protected $_warnings; diff --git a/CRM/Logging/ReportDetail.php b/CRM/Logging/ReportDetail.php index 3200b4482b..7d89f4c96d 100644 --- a/CRM/Logging/ReportDetail.php +++ b/CRM/Logging/ReportDetail.php @@ -52,7 +52,10 @@ class CRM_Logging_ReportDetail extends CRM_Report_Form { protected $altered_by; protected $altered_by_id; - // detail/summary report ids + /** + * detail/summary report ids + * @var int + */ protected $detail; protected $summary; @@ -281,7 +284,6 @@ class CRM_Logging_ReportDetail extends CRM_Report_Form { $this->diffs = $this->getAllContactChangesForConnection(); } - /** * Get an array of changes made in the mysql connection. * diff --git a/CRM/Logging/Reverter.php b/CRM/Logging/Reverter.php index 7a1085f246..844dcddca7 100644 --- a/CRM/Logging/Reverter.php +++ b/CRM/Logging/Reverter.php @@ -128,7 +128,7 @@ class CRM_Logging_Reverter { // DAO-based tables case (($tableDAO = CRM_Core_DAO_AllCoreTables::getClassForTable($table)) != FALSE): - $dao = new $tableDAO (); + $dao = new $tableDAO(); foreach ($row as $id => $changes) { $dao->id = $id; foreach ($changes as $field => $value) { diff --git a/CRM/Member/ActionMapping.php b/CRM/Member/ActionMapping.php index 3546c48f90..ee9c1b8170 100644 --- a/CRM/Member/ActionMapping.php +++ b/CRM/Member/ActionMapping.php @@ -25,7 +25,6 @@ +--------------------------------------------------------------------+ */ -use Civi\ActionSchedule\RecipientBuilder; /** * Class CRM_Member_ActionMapping diff --git a/CRM/Member/BAO/Membership.php b/CRM/Member/BAO/Membership.php index 8ad4e75449..b359fdd15d 100644 --- a/CRM/Member/BAO/Membership.php +++ b/CRM/Member/BAO/Membership.php @@ -37,11 +37,11 @@ class CRM_Member_BAO_Membership extends CRM_Member_DAO_Membership { * * @var array */ - static $_importableFields = NULL; + public static $_importableFields = NULL; - static $_renewalActType = NULL; + public static $_renewalActType = NULL; - static $_signupActType = NULL; + public static $_signupActType = NULL; /** * Class constructor. @@ -601,6 +601,7 @@ INNER JOIN civicrm_membership_type type ON ( type.id = membership.membership_ty * * @param int $membershipId * Membership id that needs to be deleted. + * @param bool $preserveContrib * * @return int * Id of deleted Membership on success, false otherwise. @@ -616,6 +617,7 @@ INNER JOIN civicrm_membership_type type ON ( type.id = membership.membership_ty * * @param int $membershipId * Membership id that needs to be deleted. + * @param bool $preserveContrib * * @return int * Id of deleted Membership on success, false otherwise. @@ -1114,7 +1116,7 @@ AND civicrm_membership.is_test = %2"; * @param CRM_Member_DAO_Membership $membership * @param \CRM_Contribute_BAO_Contribution|\CRM_Contribute_DAO_Contribution $contribution */ - static public function updateRecurMembership(CRM_Member_DAO_Membership $membership, CRM_Contribute_BAO_Contribution $contribution) { + public static function updateRecurMembership(CRM_Member_DAO_Membership $membership, CRM_Contribute_BAO_Contribution $contribution) { if (empty($contribution->contribution_recur_id)) { return; @@ -1517,6 +1519,7 @@ WHERE civicrm_membership.contact_id = civicrm_contact.id * Delete the record that are associated with this Membership Payment. * * @param int $membershipId + * @param bool $preserveContrib * * @return object * $membershipPayment deleted membership payment object @@ -2192,7 +2195,7 @@ INNER JOIN civicrm_contact contact ON ( contact.id = membership.contact_id AND * * @param int $membershipId * Membership id. - * @all bool + * @param bool $all * if more than one payment associated with membership id need to be returned. * * @return int|int[] diff --git a/CRM/Member/BAO/MembershipBlock.php b/CRM/Member/BAO/MembershipBlock.php index 79891bed99..8b785a42ec 100644 --- a/CRM/Member/BAO/MembershipBlock.php +++ b/CRM/Member/BAO/MembershipBlock.php @@ -33,6 +33,7 @@ * */ class CRM_Member_BAO_MembershipBlock extends CRM_Member_DAO_MembershipBlock { + /** * Class constructor. */ diff --git a/CRM/Member/BAO/MembershipPayment.php b/CRM/Member/BAO/MembershipPayment.php index bacf50d2f7..7a509ec3e2 100644 --- a/CRM/Member/BAO/MembershipPayment.php +++ b/CRM/Member/BAO/MembershipPayment.php @@ -34,7 +34,6 @@ */ class CRM_Member_BAO_MembershipPayment extends CRM_Member_DAO_MembershipPayment { - /** * Class constructor. */ diff --git a/CRM/Member/BAO/MembershipStatus.php b/CRM/Member/BAO/MembershipStatus.php index 8b4b532901..c3508a7e17 100644 --- a/CRM/Member/BAO/MembershipStatus.php +++ b/CRM/Member/BAO/MembershipStatus.php @@ -36,8 +36,9 @@ class CRM_Member_BAO_MembershipStatus extends CRM_Member_DAO_MembershipStatus { /** * Static holder for the default LT. + * @var int */ - static $_defaultMembershipStatus = NULL; + public static $_defaultMembershipStatus = NULL; /** * Class constructor. diff --git a/CRM/Member/BAO/MembershipType.php b/CRM/Member/BAO/MembershipType.php index 521fa621cd..7452946151 100644 --- a/CRM/Member/BAO/MembershipType.php +++ b/CRM/Member/BAO/MembershipType.php @@ -36,10 +36,11 @@ class CRM_Member_BAO_MembershipType extends CRM_Member_DAO_MembershipType { /** * Static holder for the default Membership Type. + * @var int */ - static $_defaultMembershipType = NULL; + public static $_defaultMembershipType = NULL; - static $_membershipTypeInfo = []; + public static $_membershipTypeInfo = []; /** * Class constructor. @@ -716,7 +717,6 @@ class CRM_Member_BAO_MembershipType extends CRM_Member_DAO_MembershipType { return self::$_membershipTypeInfo; } - /** * @param array $params * @param int $previousID diff --git a/CRM/Member/BAO/Query.php b/CRM/Member/BAO/Query.php index 19a526d7f8..3294569e6c 100644 --- a/CRM/Member/BAO/Query.php +++ b/CRM/Member/BAO/Query.php @@ -233,7 +233,8 @@ class CRM_Member_BAO_Query extends CRM_Core_BAO_Query { $value = ['IN' => explode(',', $value)]; } case 'membership_id': - case 'member_id': // CRM-18523 Updated to membership_id but kept member_id case for backwards compatibility + // CRM-18523 Updated to membership_id but kept member_id case for backwards compatibility + case 'member_id': case 'member_campaign_id': if (strpos($name, 'status') !== FALSE) { diff --git a/CRM/Member/Form.php b/CRM/Member/Form.php index 724aeed552..3bd495fefe 100644 --- a/CRM/Member/Form.php +++ b/CRM/Member/Form.php @@ -47,7 +47,7 @@ class CRM_Member_Form extends CRM_Contribute_Form_AbstractEditPayment { /** * Membership Type ID - * @var + * @var int */ protected $_memType; diff --git a/CRM/Member/Form/Membership.php b/CRM/Member/Form/Membership.php index bbf97b31cd..ec39152a44 100644 --- a/CRM/Member/Form/Membership.php +++ b/CRM/Member/Form/Membership.php @@ -57,6 +57,7 @@ class CRM_Member_Form_Membership extends CRM_Member_Form { /** * email of the person paying for the membership (used for receipts) + * @var string */ protected $_memberEmail = NULL; @@ -76,6 +77,7 @@ class CRM_Member_Form_Membership extends CRM_Member_Form { /** * email of the person paying for the membership (used for receipts) + * @var string */ protected $_contributorEmail = NULL; @@ -128,7 +130,7 @@ class CRM_Member_Form_Membership extends CRM_Member_Form { */ public function setDeleteMessage() { $this->deleteMessage = '' - . ts("WARNING: Deleting this membership will also delete any related payment (contribution) records." . ts("This action cannot be undone.") + . ts("WARNING: Deleting this membership will also delete any related payment (contribution) records." . ts("This action cannot be undone.") . '

' . ts("Consider modifying the membership status instead if you want to maintain an audit trail and avoid losing payment data. You can set the status to Cancelled by editing the membership and clicking the Status Override checkbox.") . '

' @@ -142,7 +144,6 @@ class CRM_Member_Form_Membership extends CRM_Member_Form { */ public function addCustomDataToForm() {} - /** * Overriding this entity trait function as not yet tested. * @@ -1730,9 +1731,12 @@ class CRM_Member_Form_Membership extends CRM_Member_Form { */ protected function updateContributionOnMembershipTypeChange($inputParams, $membership) { if (Civi::settings()->get('update_contribution_on_membership_type_change') && - ($this->_action & CRM_Core_Action::UPDATE) && // on update - $this->_id && // if ID is present - !in_array($this->_memType, $this->_memTypeSelected) // if selected membership doesn't match with earlier membership + // on update + ($this->_action & CRM_Core_Action::UPDATE) && + // if ID is present + $this->_id && + // if selected membership doesn't match with earlier membership + !in_array($this->_memType, $this->_memTypeSelected) ) { if (CRM_Utils_Array::value('is_recur', $inputParams)) { CRM_Core_Session::setStatus(ts('Associated recurring contribution cannot be updated on membership type change.', ts('Error'), 'error')); @@ -1797,6 +1801,7 @@ class CRM_Member_Form_Membership extends CRM_Member_Form { } } } + /** * Set context in session. */ diff --git a/CRM/Member/Form/MembershipBlock.php b/CRM/Member/Form/MembershipBlock.php index bf0f4554b6..83df3d77a1 100644 --- a/CRM/Member/Form/MembershipBlock.php +++ b/CRM/Member/Form/MembershipBlock.php @@ -38,6 +38,7 @@ class CRM_Member_Form_MembershipBlock extends CRM_Contribute_Form_ContributionPa /** * Store membership price set id + * @var int */ protected $_memPriceSetId = NULL; diff --git a/CRM/Member/Form/MembershipRenewal.php b/CRM/Member/Form/MembershipRenewal.php index e3857d1a5d..096e45e652 100644 --- a/CRM/Member/Form/MembershipRenewal.php +++ b/CRM/Member/Form/MembershipRenewal.php @@ -45,6 +45,7 @@ class CRM_Member_Form_MembershipRenewal extends CRM_Member_Form { /** * email of the person paying for the membership (used for receipts) + * @var string */ protected $_memberEmail = NULL; @@ -65,6 +66,7 @@ class CRM_Member_Form_MembershipRenewal extends CRM_Member_Form { /** * email of the person paying for the membership (used for receipts) + * @var string */ protected $_contributorEmail = NULL; @@ -85,6 +87,7 @@ class CRM_Member_Form_MembershipRenewal extends CRM_Member_Form { /** * context would be set to standalone if the contact is use is being selected from * the form rather than in the URL + * @var string */ public $_context; @@ -402,6 +405,8 @@ class CRM_Member_Form_MembershipRenewal extends CRM_Member_Form { * * @param array $params * (ref.) an assoc array of name/value pairs. + * @param $files + * @param $self * * @return bool|array * mixed true or array of errors diff --git a/CRM/Member/Form/MembershipStatus.php b/CRM/Member/Form/MembershipStatus.php index 030ff03cd9..5f644507e3 100644 --- a/CRM/Member/Form/MembershipStatus.php +++ b/CRM/Member/Form/MembershipStatus.php @@ -91,7 +91,7 @@ class CRM_Member_Form_MembershipStatus extends CRM_Core_Form { * We do this from the constructor in order to do a translation. */ public function setDeleteMessage() { - $this->deleteMessage = ts('You will not be able to delete this membership status if there are existing memberships with this status. You will need to check all your membership status rules afterwards to ensure that a valid status will always be available.') . " " . ts('Do you want to continue?'); + $this->deleteMessage = ts('You will not be able to delete this membership status if there are existing memberships with this status. You will need to check all your membership status rules afterwards to ensure that a valid status will always be available.') . " " . ts('Do you want to continue?'); } public function preProcess() { diff --git a/CRM/Member/Form/MembershipView.php b/CRM/Member/Form/MembershipView.php index 3d60d9a9b6..05520fb1d3 100644 --- a/CRM/Member/Form/MembershipView.php +++ b/CRM/Member/Form/MembershipView.php @@ -43,7 +43,7 @@ class CRM_Member_Form_MembershipView extends CRM_Core_Form { * * @var array */ - static $_links = NULL; + public static $_links = NULL; /** * The id of the membership being viewed. diff --git a/CRM/Member/Form/Search.php b/CRM/Member/Form/Search.php index 46a4acad2f..8eba67bfa9 100644 --- a/CRM/Member/Form/Search.php +++ b/CRM/Member/Form/Search.php @@ -61,6 +61,7 @@ class CRM_Member_Form_Search extends CRM_Core_Form_Search { /** * Prefix for the controller. + * @var string */ protected $_prefix = "member_"; diff --git a/CRM/Member/Form/Task/Batch.php b/CRM/Member/Form/Task/Batch.php index 232595017b..99d6af35a4 100644 --- a/CRM/Member/Form/Task/Batch.php +++ b/CRM/Member/Form/Task/Batch.php @@ -45,11 +45,13 @@ class CRM_Member_Form_Task_Batch extends CRM_Member_Form_Task { /** * Maximum profile fields that will be displayed. + * @var int */ protected $_maxFields = 9; /** * Variable to store redirect path. + * @var string */ protected $_userContext; diff --git a/CRM/Member/Form/Task/PickProfile.php b/CRM/Member/Form/Task/PickProfile.php index 6648dadadb..68b6ba1b53 100644 --- a/CRM/Member/Form/Task/PickProfile.php +++ b/CRM/Member/Form/Task/PickProfile.php @@ -47,11 +47,13 @@ class CRM_Member_Form_Task_PickProfile extends CRM_Member_Form_Task { /** * Maximum members that should be allowed to update + * @var int */ protected $_maxMembers = 100; /** * Variable to store redirect path + * @var string */ protected $_userContext; diff --git a/CRM/Member/Import/Field.php b/CRM/Member/Import/Field.php index fe64480430..93bb374bc8 100644 --- a/CRM/Member/Import/Field.php +++ b/CRM/Member/Import/Field.php @@ -34,17 +34,20 @@ */ class CRM_Member_Import_Field { - /**#@+ + /** + * #@+ * @var string */ /** * Name of the field + * @var string */ public $_name; /** * Title of the field to be used in display + * @var string */ public $_title; diff --git a/CRM/Member/Import/Form/MapField.php b/CRM/Member/Import/Form/MapField.php index f02fa045dc..fa849f6449 100644 --- a/CRM/Member/Import/Form/MapField.php +++ b/CRM/Member/Import/Form/MapField.php @@ -44,8 +44,7 @@ class CRM_Member_Import_Form_MapField extends CRM_Import_Form_MapField { * * @var int */ - static $_contactType = NULL; - + public static $_contactType = NULL; /** * Set variables up before form is built. diff --git a/CRM/Member/Import/Parser.php b/CRM/Member/Import/Parser.php index d8e631cc97..cf73676876 100644 --- a/CRM/Member/Import/Parser.php +++ b/CRM/Member/Import/Parser.php @@ -36,22 +36,26 @@ abstract class CRM_Member_Import_Parser extends CRM_Import_Parser { protected $_fileName; - /**#@+ + /** + * #@+ * @var integer */ /** * Imported file size + * @var int */ protected $_fileSize; /** * Seperator being used + * @var string */ protected $_seperator; /** * Total number of lines in file + * @var int */ protected $_lineCount; @@ -70,6 +74,8 @@ abstract class CRM_Member_Import_Parser extends CRM_Import_Parser { * @param int $mode * @param int $contactType * @param int $onDuplicate + * @param int $statusID + * @param int $totalRowCount * * @return mixed * @throws Exception diff --git a/CRM/Member/Import/Parser/Membership.php b/CRM/Member/Import/Parser/Membership.php index 974c4294de..66147109a9 100644 --- a/CRM/Member/Import/Parser/Membership.php +++ b/CRM/Member/Import/Parser/Membership.php @@ -51,7 +51,7 @@ class CRM_Member_Import_Parser_Membership extends CRM_Member_Import_Parser { /** * Array of successfully imported membership id's * - * @array + * @var array */ protected $_newMemberships; diff --git a/CRM/Member/Info.php b/CRM/Member/Info.php index c0f177ca2c..059c720726 100644 --- a/CRM/Member/Info.php +++ b/CRM/Member/Info.php @@ -38,6 +38,7 @@ class CRM_Member_Info extends CRM_Core_Component_Info { /** + * @var string * @inheritDoc */ protected $keyword = 'member'; @@ -51,6 +52,7 @@ class CRM_Member_Info extends CRM_Core_Component_Info { * @return array * collection of required component settings */ + /** * @return array */ @@ -64,7 +66,6 @@ class CRM_Member_Info extends CRM_Core_Component_Info { ]; } - /** * @inheritDoc * Provides permissions that are used by component. @@ -115,6 +116,7 @@ class CRM_Member_Info extends CRM_Core_Component_Info { * collection of required dashboard settings, * null if no element offered */ + /** * @return array|null */ @@ -139,6 +141,7 @@ class CRM_Member_Info extends CRM_Core_Component_Info { * collection of required dashboard settings, * null if no element offered */ + /** * @return array|null */ @@ -167,6 +170,7 @@ class CRM_Member_Info extends CRM_Core_Component_Info { * collection of required pane settings, * null if no element offered */ + /** * @return array|null */ @@ -187,6 +191,7 @@ class CRM_Member_Info extends CRM_Core_Component_Info { * @return array|null * collection of activity types */ + /** * @return array|null */ diff --git a/CRM/Member/Page/MembershipStatus.php b/CRM/Member/Page/MembershipStatus.php index 9cf8744240..c4e4b605d0 100644 --- a/CRM/Member/Page/MembershipStatus.php +++ b/CRM/Member/Page/MembershipStatus.php @@ -45,7 +45,7 @@ class CRM_Member_Page_MembershipStatus extends CRM_Core_Page_Basic { * * @var array */ - static $_links = NULL; + public static $_links = NULL; /** * Get BAO Name. diff --git a/CRM/Member/Page/MembershipType.php b/CRM/Member/Page/MembershipType.php index 96c16a60a8..e7807d67da 100644 --- a/CRM/Member/Page/MembershipType.php +++ b/CRM/Member/Page/MembershipType.php @@ -43,7 +43,7 @@ class CRM_Member_Page_MembershipType extends CRM_Core_Page { * * @var array */ - static $_links = NULL; + public static $_links = NULL; public $useLivePageJS = TRUE; diff --git a/CRM/Member/Page/Tab.php b/CRM/Member/Page/Tab.php index f51fdc1325..9d6f944e11 100644 --- a/CRM/Member/Page/Tab.php +++ b/CRM/Member/Page/Tab.php @@ -39,8 +39,8 @@ class CRM_Member_Page_Tab extends CRM_Core_Page { * * @var array */ - static $_links = NULL; - static $_membershipTypesLinks = NULL; + public static $_links = NULL; + public static $_membershipTypesLinks = NULL; public $_permission = NULL; public $_contactId = NULL; diff --git a/CRM/Member/PseudoConstant.php b/CRM/Member/PseudoConstant.php index af904929f7..417de01f0f 100644 --- a/CRM/Member/PseudoConstant.php +++ b/CRM/Member/PseudoConstant.php @@ -92,7 +92,7 @@ class CRM_Member_PseudoConstant extends CRM_Core_PseudoConstant { * @param bool $allStatus * * @return array - * array reference of all membership statuses if any + * array reference of all membership statuses if any */ public static function &membershipStatus($id = NULL, $cond = NULL, $column = 'name', $force = FALSE, $allStatus = FALSE) { if (self::$membershipStatus === NULL) { diff --git a/CRM/Member/Selector/Search.php b/CRM/Member/Selector/Search.php index 7775ecde8c..850046d865 100644 --- a/CRM/Member/Selector/Search.php +++ b/CRM/Member/Selector/Search.php @@ -43,20 +43,20 @@ class CRM_Member_Selector_Search extends CRM_Core_Selector_Base implements CRM_C * * @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', 'membership_id', 'contact_type', diff --git a/CRM/Member/Task.php b/CRM/Member/Task.php index 0827a26780..3d17b53fdf 100644 --- a/CRM/Member/Task.php +++ b/CRM/Member/Task.php @@ -40,11 +40,15 @@ * */ class CRM_Member_Task extends CRM_Core_Task { - const - // Member tasks - LABEL_MEMBERS = 201; + /** + * Member tasks + */ + const LABEL_MEMBERS = 201; - static $objectType = 'membership'; + /** + * @var string + */ + public static $objectType = 'membership'; /** * These tasks are the core set of tasks that the user can perform diff --git a/CRM/Member/Tokens.php b/CRM/Member/Tokens.php index 3e2dc921f8..44100317ac 100644 --- a/CRM/Member/Tokens.php +++ b/CRM/Member/Tokens.php @@ -63,8 +63,7 @@ class CRM_Member_Tokens extends \Civi\Token\AbstractTokenSubscriber { */ public function checkActive(\Civi\Token\TokenProcessor $processor) { // Extracted from scheduled-reminders code. See the class description. - return - !empty($processor->context['actionMapping']) + return !empty($processor->context['actionMapping']) && $processor->context['actionMapping']->getEntity() === 'civicrm_membership'; } diff --git a/CRM/Note/Form/Note.php b/CRM/Note/Form/Note.php index 2b7478d64d..9e1cfeebde 100644 --- a/CRM/Note/Form/Note.php +++ b/CRM/Note/Form/Note.php @@ -143,8 +143,7 @@ class CRM_Note_Form_Note extends CRM_Core_Form { 'type' => 'cancel', 'name' => ts('Cancel'), ], - ] - ); + ]); return; } @@ -166,7 +165,7 @@ class CRM_Note_Form_Note extends CRM_Core_Form { 'type' => 'cancel', 'name' => ts('Cancel'), ], - ] + ] ); } diff --git a/CRM/Price/BAO/LineItem.php b/CRM/Price/BAO/LineItem.php index 55af3bcca8..4524376162 100644 --- a/CRM/Price/BAO/LineItem.php +++ b/CRM/Price/BAO/LineItem.php @@ -799,7 +799,7 @@ WHERE li.contribution_id = %1"; * @param array $lineItemsToUpdate * * @return array - * List of formatted reverse Financial Items to be recorded + * List of formatted reverse Financial Items to be recorded */ protected function getAdjustedFinancialItemsToRecord($entityID, $entityTable, $contributionID, $priceFieldValueIDsToCancel, $lineItemsToUpdate) { $previousLineItems = CRM_Price_BAO_LineItem::getLineItems($entityID, str_replace('civicrm_', '', $entityTable)); @@ -872,7 +872,7 @@ WHERE li.contribution_id = %1"; * @param array $feeBlock * * @return array - * List of submitted line items + * List of submitted line items */ protected function getSubmittedLineItems($inputParams, $feeBlock) { $submittedLineItems = []; @@ -896,7 +896,7 @@ WHERE li.contribution_id = %1"; * @param string $entity * * @return array - * Array of line items to alter with the following keys + * Array of line items to alter with the following keys * - line_items_to_add. If the line items required are new radio options that * have not previously been set then we should add line items for them * - line_items_to_update. If we have already been an active option and a change has @@ -980,6 +980,7 @@ WHERE li.contribution_id = %1"; return TRUE; } } + /** * Add line Items as result of fee change. * diff --git a/CRM/Price/BAO/PriceField.php b/CRM/Price/BAO/PriceField.php index f6bb649921..0085d6ec89 100644 --- a/CRM/Price/BAO/PriceField.php +++ b/CRM/Price/BAO/PriceField.php @@ -842,7 +842,8 @@ WHERE id IN (" . implode(',', array_keys($priceFields)) . ')'; $error['_qf_default'] = ts('%1 amount can not be less than zero. Please select the options accordingly.', [1 => $componentName]); } elseif ($totalAmount > 0 && - $totalPaymentAmountEnteredOnForm >= $totalAmount && // if total amount is equal to all selected amount in hand + // if total amount is equal to all selected amount in hand + $totalPaymentAmountEnteredOnForm >= $totalAmount && (CRM_Utils_Array::value('contribution_status_id', $fields) == CRM_Core_PseudoConstant::getKey('CRM_Contribute_DAO_Contribution', 'contribution_status_id', 'Partially paid')) ) { $error['total_amount'] = ts('You have specified the status Partially Paid but have entered an amount that equals or exceeds the amount due. Please adjust the status of the payment or the amount'); diff --git a/CRM/Price/BAO/PriceSet.php b/CRM/Price/BAO/PriceSet.php index cd2908f7b6..ff2e0c3b77 100644 --- a/CRM/Price/BAO/PriceSet.php +++ b/CRM/Price/BAO/PriceSet.php @@ -42,7 +42,7 @@ class CRM_Price_BAO_PriceSet extends CRM_Price_DAO_PriceSet { * * @var array */ - static $_defaultPriceSet = NULL; + public static $_defaultPriceSet = NULL; /** * Class constructor. @@ -559,7 +559,6 @@ WHERE id = %1"; return (int) implode('_', array_keys($priceSet['fields'][$priceFieldID]['options'])); } - /** * Initiate price set such that various non-BAO things are set on the form. * diff --git a/CRM/Price/Form/Field.php b/CRM/Price/Form/Field.php index 3888e781e8..dc237c1fa7 100644 --- a/CRM/Price/Form/Field.php +++ b/CRM/Price/Form/Field.php @@ -64,6 +64,7 @@ class CRM_Price_Form_Field extends CRM_Core_Form { /** * Variable is set if price set is used for membership. + * @var bool */ protected $_useForMember; diff --git a/CRM/Price/Page/Option.php b/CRM/Price/Page/Option.php index a8ec96fb8d..bdf06ffc36 100644 --- a/CRM/Price/Page/Option.php +++ b/CRM/Price/Page/Option.php @@ -122,14 +122,14 @@ class CRM_Price_Page_Option extends CRM_Core_Page { */ public function browse() { $priceOptions = civicrm_api3('PriceFieldValue', 'get', [ - 'price_field_id' => $this->_fid, + 'price_field_id' => $this->_fid, // Explicitly do not check permissions so we are not // restricted by financial type, so we can change them. - 'check_permissions' => FALSE, - 'options' => [ - 'limit' => 0, - 'sort' => ['weight', 'label'], - ], + 'check_permissions' => FALSE, + 'options' => [ + 'limit' => 0, + 'sort' => ['weight', 'label'], + ], ]); $customOption = $priceOptions['values']; -- 2.25.1