diff --git a/CRM/Admin/Form/Preferences/Address.php b/CRM/Admin/Form/Preferences/Address.php index 1b2eac7a0b5d..57be327a5967 100644 --- a/CRM/Admin/Form/Preferences/Address.php +++ b/CRM/Admin/Form/Preferences/Address.php @@ -43,8 +43,8 @@ public function preProcess() { // Address Standardization $addrProviders = array( - '' => '- select -' - ) + CRM_Core_SelectValues::addressProvider(); + '' => '- select -', + ) + CRM_Core_SelectValues::addressProvider(); $this->_varNames = array( CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME => array( diff --git a/CRM/Admin/Form/Setting/Mapping.php b/CRM/Admin/Form/Setting/Mapping.php index a8a052b75aef..ee0acdd7f613 100644 --- a/CRM/Admin/Form/Setting/Mapping.php +++ b/CRM/Admin/Form/Setting/Mapping.php @@ -88,8 +88,6 @@ public static function formRule($fields) { * add the rules (mainly global rules) for form. * All local rules are added near the element * - * @param null - * * @return void */ public function addRules() { diff --git a/CRM/Admin/Page/AJAX.php b/CRM/Admin/Page/AJAX.php index 35d7aa9e2c8f..a95514675eea 100644 --- a/CRM/Admin/Page/AJAX.php +++ b/CRM/Admin/Page/AJAX.php @@ -115,7 +115,7 @@ public static function getStatusMsg() { $ret['illegal'] = TRUE; $table = $template->fetch('CRM/Price/Page/table.tpl'); $ret['content'] = ts('Unable to disable the \'%1\' price set - it is currently in use by one or more active events, contribution pages or contributions.', array( - 1 => $priceSet + 1 => $priceSet, )) . "
$table"; } else { diff --git a/CRM/Contact/Form/Edit/Address.php b/CRM/Contact/Form/Edit/Address.php index aff4eb7d354b..9e62aaee70c9 100644 --- a/CRM/Contact/Form/Edit/Address.php +++ b/CRM/Contact/Form/Edit/Address.php @@ -74,7 +74,7 @@ public static function buildQuickForm(&$form, $addressBlockCount = NULL, $sharin //make location type required for inline edit $form->addSelect("address[$blockId][location_type_id]", array( 'entity' => 'address', - 'class' => 'eight' + 'class' => 'eight', ) + $js, $inlineEdit); if (!$inlineEdit) { @@ -118,12 +118,12 @@ public static function buildQuickForm(&$form, $addressBlockCount = NULL, $sharin 'postal_code' => array( ts('Zip / Postal Code'), array_merge($attributes['postal_code'], array('class' => 'crm_postal_code')), - NULL + NULL, ), 'postal_code_suffix' => array( ts('Postal Code Suffix'), array('size' => 4, 'maxlength' => 12, 'class' => 'crm_postal_code_suffix'), - NULL + NULL, ), 'country_id' => array(ts('Country'), $attributes['country_id'], 'country'), 'state_province_id' => array(ts('State/Province'), $attributes['state_province_id'], NULL), @@ -144,7 +144,7 @@ public static function buildQuickForm(&$form, $addressBlockCount = NULL, $sharin if (in_array($nameWithoutID, array( 'street_number', 'street_name', - 'street_unit' + 'street_unit', )) && !empty($addressOptions['street_address_parsing']) ) { $continue = FALSE; @@ -265,7 +265,7 @@ public static function buildQuickForm(&$form, $addressBlockCount = NULL, $sharin $profileLinks = CRM_Core_BAO_UFGroup::getCreateLinks(array( 'new_individual', 'new_organization', - 'new_household' + 'new_household', ), 'shared_address'); $form->addEntityRef("address[$blockId][master_contact_id]", ts('Share With'), array('create' => $profileLinks)); } @@ -359,7 +359,7 @@ public static function setDefaultValues(&$defaults, &$form) { 'name' => $shareAddressContactNames[$addressValue['master_id']]['name'], 'options' => CRM_Core_BAO_Address::getValues(array( 'entity_id' => $master_cid, - 'contact_id' => $master_cid + 'contact_id' => $master_cid, )), 'master_id' => $addressValue['master_id'], ); @@ -387,11 +387,11 @@ public static function setDefaultValues(&$defaults, &$form) { 'street_number', 'street_number_suffix', 'street_name', - 'street_unit' + 'street_unit', ) as $fld) { if (in_array($fld, array( 'street_name', - 'street_unit' + 'street_unit', ))) { $streetAddress .= ' '; } diff --git a/CRM/Contact/Form/Search/Custom.php b/CRM/Contact/Form/Search/Custom.php index 7c4edc51724d..ad8e178bb483 100644 --- a/CRM/Contact/Form/Search/Custom.php +++ b/CRM/Contact/Form/Search/Custom.php @@ -70,7 +70,7 @@ public function preProcess() { 'url' => CRM_Utils_System::url('civicrm/contact/search/custom/list', 'reset=1' ), - ) + ), ); CRM_Utils_System::appendBreadCrumb($breadCrumb); diff --git a/CRM/Contact/Form/Task/Result.php b/CRM/Contact/Form/Task/Result.php index 3696721a679e..f8e04f498195 100644 --- a/CRM/Contact/Form/Task/Result.php +++ b/CRM/Contact/Form/Task/Result.php @@ -54,7 +54,7 @@ public function preProcess() { $context = $this->get('context'); if (in_array($context, array( 'smog', - 'amtg' + 'amtg', ))) { $urlParams = 'reset=1&force=1&context=smog&gid='; $urlParams .= ($context == 'smog') ? $this->get('gid') : $this->get('amtgID'); @@ -94,7 +94,6 @@ public function preProcess() { $url = CRM_Utils_System::url('civicrm/contact/' . $fragment, $path); $session->replaceUserContext($url); - return; } /** diff --git a/CRM/Contact/Import/Parser/Contact.php b/CRM/Contact/Import/Parser/Contact.php index 0e00b30a59c0..72393cfb39f0 100644 --- a/CRM/Contact/Import/Parser/Contact.php +++ b/CRM/Contact/Import/Parser/Contact.php @@ -102,7 +102,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser { /** * Class constructor */ - function __construct( + public function __construct( &$mapperKeys, $mapperLocType = NULL, $mapperPhoneType = NULL, $mapperImProvider = NULL, $mapperRelated = NULL, $mapperRelatedContactType = NULL, $mapperRelatedContactDetails = NULL, $mapperRelatedContactLocType = NULL, $mapperRelatedContactPhoneType = NULL, $mapperRelatedContactImProvider = NULL, $mapperWebsiteType = NULL, $mapperRelatedContactWebsiteType = NULL ) { @@ -148,8 +148,8 @@ public function init() { } //Relationship importables - $this->_relationships = $relations = - CRM_Contact_BAO_Relationship::getContactRelationshipType( + $this->_relationships = $relations + = CRM_Contact_BAO_Relationship::getContactRelationshipType( NULL, NULL, NULL, $this->_contactType, FALSE, 'label', TRUE, $this->_contactSubType ); @@ -250,7 +250,7 @@ public function init() { * @param array $values * The array of values belonging to this line. * - * @return boolean + * @return bool */ public function mapField(&$values) { return CRM_Import_Parser::VALID; @@ -262,7 +262,7 @@ public function mapField(&$values) { * @param array $values * The array of values belonging to this line. * - * @return boolean + * @return bool * the result of this processing */ public function preview(&$values) { @@ -275,7 +275,7 @@ public function preview(&$values) { * @param array $values * The array of values belonging to this line. * - * @return boolean + * @return boo * the result of this processing */ public function summary(&$values) { @@ -449,7 +449,7 @@ public function summary(&$values) { * * @param bool $doGeocodeAddress * - * @return boolean + * @return bool * the result of this processing */ public function import($onDuplicate, &$values, $doGeocodeAddress = FALSE) { @@ -1013,8 +1013,6 @@ public function import($onDuplicate, &$values, $doGeocodeAddress = FALSE) { $newContact = $this->createContact($formatted, $contactFields, $onDuplicate, $contactId); } // else skip does nothing and just returns an error code. - - if ($cid) { $contact = array( 'contact_id' => $cid, diff --git a/CRM/Contribute/BAO/Query.php b/CRM/Contribute/BAO/Query.php index 88e97572a107..c0d5791315b5 100644 --- a/CRM/Contribute/BAO/Query.php +++ b/CRM/Contribute/BAO/Query.php @@ -138,7 +138,7 @@ public static function select(&$query) { // get payment instrument id if (!empty($query->_returnProperties['payment_instrument_id'])) { - $query->_select['instrument_id'] = "contribution_payment_instrument.value as instrument_id"; + $query->_select['instrument_id'] = "contribution_payment_instrument.value as instrument_id"; $query->_select['payment_instrument_id'] = "contribution_payment_instrument.value as payment_instrument_id"; $query->_element['instrument_id'] = $query->_element['payment_instrument_id'] = 1; $query->_tables['civicrm_contribution'] = 1; @@ -362,7 +362,7 @@ public static function whereClauseSingle(&$values, &$query) { case 'financial_type': $query->_where[$grouping][] = CRM_Contact_BAO_Query::buildClause($fields[$name]['where'], $op, $value, 'String'); - CRM_Core_Error::debug( '$query', $query->_where[$grouping] ); + CRM_Core_Error::debug('$query', $query->_where[$grouping]); list($op, $value) = CRM_Contact_BAO_Query::buildQillForFieldValue('CRM_Contribute_DAO_Contribution', $name, $value, $op); $query->_qill[$grouping][] = ts('%1 %2 %3', array(1 => $fields[$name]['title'], 2 => $op, 3 => $value)); $query->_tables['civicrm_contribution'] = $query->_whereTables['civicrm_contribution'] = 1; @@ -876,7 +876,7 @@ public static function buildSearchForm(&$form) { $form->add('select', 'contribution_currency_type', ts('Currency Type'), array( - '' => ts('- any -') + '' => ts('- any -'), ) + CRM_Core_PseudoConstant::get('CRM_Contribute_DAO_Contribution', 'currency', array('labelColumn' => 'name')), FALSE, array('class' => 'crm-select2') @@ -890,7 +890,7 @@ public static function buildSearchForm(&$form) { $form->add('select', 'contribution_page_id', ts('Contribution Page'), array( - '' => ts('- any -') + '' => ts('- any -'), ) + CRM_Contribute_PseudoConstant::contributionPage(), FALSE, array('class' => 'crm-select2') @@ -903,7 +903,7 @@ public static function buildSearchForm(&$form) { $form->add('select', 'contribution_pcp_made_through_id', ts('Personal Campaign Page'), array( - '' => ts('- any -') + '' => ts('- any -'), ) + CRM_Contribute_PseudoConstant::pcPage(), FALSE, array('class' => 'crm-select2') @@ -1038,7 +1038,7 @@ public static function tableNames(&$tables) { public static function buildDateWhere(&$values, $query, $name, $field, $title) { $fieldPart = strpos($name, $field); if ($fieldPart === FALSE) { - return; + return NULL; } // we only have recurring dates using this ATM so lets' short cut to find the table name $table = 'contribution_recur'; diff --git a/CRM/Contribute/Form/CancelSubscription.php b/CRM/Contribute/Form/CancelSubscription.php index 99553db3cbf2..9f06661bd9d7 100644 --- a/CRM/Contribute/Form/CancelSubscription.php +++ b/CRM/Contribute/Form/CancelSubscription.php @@ -125,8 +125,8 @@ public function preProcess() { $this->assign('mode', $this->_mode); if ($this->_subscriptionDetails->contact_id) { - list($this->_donorDisplayName, $this->_donorEmail) = - CRM_Contact_BAO_Contact::getContactDetails($this->_subscriptionDetails->contact_id); + list($this->_donorDisplayName, $this->_donorEmail) + = CRM_Contact_BAO_Contact::getContactDetails($this->_subscriptionDetails->contact_id); } } @@ -186,8 +186,6 @@ public function buildQuickForm() { * Set default values for the form. Note that in edit/view mode * the default values are retrieved from the database * - * @param null - * * @return array * array of default values */ @@ -227,8 +225,8 @@ public function postProcess() { CRM_Core_Error::displaySessionError($cancelSubscription); } elseif ($cancelSubscription) { - $activityParams = - array( + $activityParams + = array( 'subject' => $this->_mid ? ts('Auto-renewal membership cancelled') : ts('Recurring contribution cancelled'), 'details' => $message, ); @@ -244,10 +242,10 @@ public function postProcess() { $inputParams = array('id' => $this->_mid); CRM_Member_BAO_Membership::getValues($inputParams, $tplParams); $tplParams = $tplParams[$this->_mid]; - $tplParams['membership_status'] = - CRM_Core_DAO::getFieldValue('CRM_Member_DAO_MembershipStatus', $tplParams['status_id']); - $tplParams['membershipType'] = - CRM_Core_DAO::getFieldValue('CRM_Member_DAO_MembershipType', $tplParams['membership_type_id']); + $tplParams['membership_status'] + = CRM_Core_DAO::getFieldValue('CRM_Member_DAO_MembershipStatus', $tplParams['status_id']); + $tplParams['membershipType'] + = CRM_Core_DAO::getFieldValue('CRM_Member_DAO_MembershipType', $tplParams['membership_type_id']); $status = ts('The automatic renewal of your %1 membership has been cancelled as requested. This does not affect the status of your membership - you will receive a separate notification when your membership is up for renewal.', array(1 => $tplParams['membershipType'])); $msgTitle = 'Membership Renewal Cancelled'; $msgType = 'info'; @@ -277,9 +275,8 @@ public function postProcess() { $value, array('title', 'receipt_from_name', 'receipt_from_email') ); - $receiptFrom = - '"' . - CRM_Utils_Array::value('receipt_from_name', $value[$this->_subscriptionDetails->contribution_page_id]) . + $receiptFrom + = '"' . CRM_Utils_Array::value('receipt_from_name', $value[$this->_subscriptionDetails->contribution_page_id]) . '" <' . $value[$this->_subscriptionDetails->contribution_page_id]['receipt_from_email'] . '>'; @@ -290,8 +287,8 @@ public function postProcess() { } // send notification - $sendTemplateParams = - array( + $sendTemplateParams + = array( 'groupName' => $this->_mode == 'auto_renew' ? 'msg_tpl_workflow_membership' : 'msg_tpl_workflow_contribution', 'valueName' => $this->_mode == 'auto_renew' ? 'membership_autorenew_cancelled' : 'contribution_recurring_cancelled', 'contactId' => $this->_subscriptionDetails->contact_id, @@ -328,11 +325,12 @@ public function postProcess() { $session->setStatus($status, $msgTitle, $msgType); } elseif (!$userID) { - if ($status) + if ($status) { CRM_Utils_System::setUFMessage($status); - // keep result as 1, since we not displaying anything on the redirected page anyway - return CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/contribute/subscriptionstatus', + // keep result as 1, since we not displaying anything on the redirected page anyway + return CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/contribute/subscriptionstatus', "reset=1&task=cancel&result=1")); + } } } } diff --git a/CRM/Core/BAO/Email.php b/CRM/Core/BAO/Email.php index 33ff4babd789..87649e5d9fbc 100644 --- a/CRM/Core/BAO/Email.php +++ b/CRM/Core/BAO/Email.php @@ -117,7 +117,7 @@ public static function add(&$params) { * @param array $entityBlock * Input parameters to find object. * - * @return boolean + * @return bool */ public static function &getValues($entityBlock) { return CRM_Core_BAO_Block::getValues('email', $entityBlock); diff --git a/CRM/Core/BAO/LabelFormat.php b/CRM/Core/BAO/LabelFormat.php index 0de74960ee72..089a23a2cf7d 100644 --- a/CRM/Core/BAO/LabelFormat.php +++ b/CRM/Core/BAO/LabelFormat.php @@ -157,8 +157,6 @@ class CRM_Core_BAO_LabelFormat extends CRM_Core_DAO_OptionValue { /** * Get page orientations recognized by the DOMPDF package used to create PDF letters. * - * @param void - * * @return array * array of page orientations */ @@ -186,8 +184,6 @@ public static function getFontNames($name = 'label_format') { /** * Get font sizes supported by the TCPDF package used to create PDF labels. * - * @param void - * * @return array * array of font sizes */ @@ -203,8 +199,6 @@ public static function getFontSizes() { /** * Get measurement units recognized by the TCPDF package used to create PDF labels. * - * @param void - * * @return array * array of measurement units */ @@ -220,8 +214,6 @@ public static function getUnits() { /** * Get text alignment recognized by the TCPDF package used to create PDF labels. * - * @param void - * * @return array * array of alignments */ @@ -236,8 +228,6 @@ public static function getTextAlignments() { /** * Get text alignment recognized by the TCPDF package used to create PDF labels. * - * @param void - * * @return array * array of alignments */ @@ -280,6 +270,7 @@ private static function _getGid($name = 'label_format') { public static function addOrder(&$list, $returnURL) { $filter = "option_group_id = " . self::_getGid(); CRM_Utils_Weight::addOrder($list, 'CRM_Core_DAO_OptionValue', 'id', $returnURL, $filter); + return $list; } /** @@ -462,8 +453,6 @@ public static function retrieve(&$params, &$values, $groupName = 'label_format') /** * Return the name of the group for customized labels * - * @param void - * * @return void */ public static function customGroupName() { diff --git a/CRM/Core/BAO/Mapping.php b/CRM/Core/BAO/Mapping.php index 243e496746d5..1c5b94a933b4 100644 --- a/CRM/Core/BAO/Mapping.php +++ b/CRM/Core/BAO/Mapping.php @@ -68,7 +68,7 @@ public static function retrieve(&$params, &$defaults) { * @param int $id * Mapping id. * - * @return boolean + * @return boo */ public static function del($id) { // delete from mapping_field table @@ -204,7 +204,7 @@ public static function getMappingFields($mappingId) { * @param string $mapTypeId * mapping Type. * - * @return boolean + * @return boo */ public static function checkMapping($nameField, $mapTypeId) { $mapping = new CRM_Core_DAO_Mapping(); @@ -363,7 +363,7 @@ public static function buildMappingForm(&$form, $mappingType = 'Export', $mappin foreach (array( 'groups', 'tags', - 'notes' + 'notes', ) as $value) { unset($fields['Individual'][$value]); unset($fields['Household'][$value]); @@ -388,7 +388,7 @@ public static function buildMappingForm(&$form, $mappingType = 'Export', $mappin $fields['Contact']['note_body'] = array('title' => $noteTitle . ': ' . ts('Body Only'), 'name' => 'note_body'); $fields['Contact']['note_subject'] = array( 'title' => $noteTitle . ': ' . ts('Subject Only'), - 'name' => 'note_subject' + 'name' => 'note_subject', ); } } @@ -472,8 +472,8 @@ public static function buildMappingForm(&$form, $mappingType = 'Export', $mappin $csRelationships = array(); if ($mappingType == 'Export') { - $subTypeRelationshipTypes = - CRM_Contact_BAO_Relationship::getContactRelationshipType(NULL, NULL, NULL, $val['parent'], + $subTypeRelationshipTypes + = CRM_Contact_BAO_Relationship::getContactRelationshipType(NULL, NULL, NULL, $val['parent'], FALSE, 'label', TRUE, $subType); foreach ($subTypeRelationshipTypes as $key => $var) { @@ -1109,8 +1109,6 @@ public static function formattedFields(&$params, $row = FALSE) { 0, ); } - - return $fields; } @@ -1190,7 +1188,7 @@ public static function saveMappingFields(&$params, $mappingId) { $mappingFields->delete(); if (empty($params['mapper'])) { - return; + return NULL; } //save record in mapping field table diff --git a/CRM/Core/BAO/Note.php b/CRM/Core/BAO/Note.php index bc8fd6c7a708..59307f1108e6 100644 --- a/CRM/Core/BAO/Note.php +++ b/CRM/Core/BAO/Note.php @@ -78,7 +78,7 @@ public static function getNoteSubject($id) { * @param object $note * Either the id of the note to retrieve, or the CRM_Core_DAO_Note object itself. * - * @return boolean + * @return bool * TRUE if the note should be displayed, otherwise FALSE * */ @@ -223,7 +223,7 @@ public static function &add(&$params, $ids = array()) { * @param array $params * (reference ) an assoc array of name/value pairs. * - * @return boolean + * @return bool */ public static function dataExists(&$params) { // return if no data present diff --git a/CRM/Core/Controller.php b/CRM/Core/Controller.php index cd62a31fe7f1..34c3cf39c11f 100644 --- a/CRM/Core/Controller.php +++ b/CRM/Core/Controller.php @@ -173,7 +173,7 @@ class CRM_Core_Controller extends HTML_QuickForm_Controller { * @param bool $ignoreKey * Should we not set a qfKey for this controller (for standalone forms). */ - function __construct( + public function __construct( $title = NULL, $modal = TRUE, $mode = NULL, @@ -193,8 +193,8 @@ function __construct( // lets try to get it from the session and/or the request vars // we do this early on in case there is a fatal error in retrieving the // key and/or session - $this->_entryURL = - CRM_Utils_Request::retrieve('entryURL', 'String', $this); + $this->_entryURL + = CRM_Utils_Request::retrieve('entryURL', 'String', $this); // add a unique validable key to the name $name = CRM_Utils_System::getClassName($this); @@ -379,8 +379,8 @@ public function validate() { * Helper function to add all the needed default actions. Note that the framework * redefines all of the default QFC actions * - * @param string directory to store all the uploaded files - * @param array names for the various upload buttons (note u can have more than 1 upload) + * @param string $uploadDirectory to store all the uploaded files + * @param array $uploadNames for the various upload buttons (note u can have more than 1 upload) * * * @return void @@ -661,7 +661,7 @@ public function setEmbedded($embedded) { /** * Getter for embedded * - * @return boolean + * @return bool * return the embedded value */ public function getEmbedded() { @@ -682,7 +682,7 @@ public function setSkipRedirection($skipRedirection) { /** * Getter for skipRedirection * - * @return boolean + * @return bool * return the skipRedirection value */ public function getSkipRedirection() { @@ -738,7 +738,7 @@ public function setPrint($print) { /** * Getter for print * - * @return boolean + * @return bool * return the print value */ public function getPrint() { diff --git a/CRM/Core/LegacyErrorHandler.php b/CRM/Core/LegacyErrorHandler.php index b10026ac6b90..57b8c80e6852 100644 --- a/CRM/Core/LegacyErrorHandler.php +++ b/CRM/Core/LegacyErrorHandler.php @@ -5,7 +5,7 @@ class CRM_Core_LegacyErrorHandler { * @param \Civi\Core\Event\UnhandledExceptionEvent $event * @throws Exception */ - static function handleException($event) { + public static function handleException($event) { $e = $event->exception; if ($e instanceof CRM_Core_Exception) { $params = $e->getErrorData(); diff --git a/CRM/Core/Page/AJAX.php b/CRM/Core/Page/AJAX.php index 74fbc48a3bc3..af7ae6613a40 100644 --- a/CRM/Core/Page/AJAX.php +++ b/CRM/Core/Page/AJAX.php @@ -73,7 +73,7 @@ public static function run() { // FIXME: This is done to maintain current wire protocol, but it might be // simpler to just require different 'types' for pages and forms if (preg_match('/^CRM_[a-zA-Z0-9]+_Page_Inline_/', $className)) { - $page = new $className; + $page = new $className(); $page->run(); } else { diff --git a/CRM/Core/Payment.php b/CRM/Core/Payment.php index ab50f68298fd..97f9417ae3d9 100644 --- a/CRM/Core/Payment.php +++ b/CRM/Core/Payment.php @@ -303,7 +303,7 @@ public function getPaymentFormFieldsMetadata() { 'rule_message' => ts('Please enter a valid value for your card security code. This is usually the last 3-4 digits on the card\'s signature panel.'), 'rule_name' => 'integer', 'rule_parameters' => NULL, - ) + ), ), ), 'credit_card_exp_date' => array( @@ -318,7 +318,7 @@ public function getPaymentFormFieldsMetadata() { 'rule_message' => ts('Card expiration date cannot be a past date.'), 'rule_name' => 'currentDate', 'rule_parameters' => TRUE, - ) + ), ), ), 'credit_card_type' => array( @@ -357,7 +357,7 @@ public function getPaymentFormFieldsMetadata() { 'rule_message' => ts('Please enter a valid Bank Identification Number (value must not contain punctuation characters).'), 'rule_name' => 'nopunctuation', 'rule_parameters' => NULL, - ) + ), ), 'is_required' => TRUE, ), @@ -378,7 +378,7 @@ public function getPaymentFormFieldsMetadata() { 'rule_message' => ts('Please enter a valid Bank Identification Number (value must not contain punctuation characters).'), 'rule_name' => 'nopunctuation', 'rule_parameters' => NULL, - ) + ), ), ), 'bank_name' => array( @@ -408,7 +408,7 @@ public function getPaymentFormFieldsMetadata() { * the result in an nice formatted array (or an error object) * @abstract */ - abstract function doDirectPayment(&$params); + abstract protected function doDirectPayment(&$params); /** * Process payment - this function wraps around both doTransferPayment and doDirectPayment @@ -442,7 +442,7 @@ public function doPayment(&$params, $component) { * @return string * the error message if any */ - abstract function checkConfig(); + abstract protected function checkConfig(); /** * @param $paymentProcessor @@ -589,7 +589,7 @@ public static function handlePaymentMethod($method, $params = array()) { * @param string $method * Method to check for. * - * @return boolean + * @return bool */ public function isSupported($method = 'cancelSubscription') { return method_exists(CRM_Utils_System::getClassName($this), $method); diff --git a/CRM/Core/Payment/AuthorizeNet.php b/CRM/Core/Payment/AuthorizeNet.php index a62030a1852f..da729de70aa9 100644 --- a/CRM/Core/Payment/AuthorizeNet.php +++ b/CRM/Core/Payment/AuthorizeNet.php @@ -396,7 +396,7 @@ public function _checkDupe($invoiceId) { * * @return string * the HMAC_MD5 encoding string - **/ + */ public function hmac($key, $data) { if (function_exists('mhash')) { // Use PHP mhash extension @@ -459,7 +459,7 @@ public function checkMD5($responseMD5, $transaction_id, $amount, $ipn = FALSE) { * * @return string * fingerprint - **/ + */ public function CalculateFP() { $x_tran_key = $this->_getParam('paymentKey'); $loginid = $this->_getParam('apiLogin'); diff --git a/CRM/Core/Permission/Base.php b/CRM/Core/Permission/Base.php index 5e4f239161dc..be049664f248 100644 --- a/CRM/Core/Permission/Base.php +++ b/CRM/Core/Permission/Base.php @@ -156,10 +156,7 @@ public function groupClause($type, &$tables, &$whereTables) { * @param string $str * The permission to check. * - * @return boolean - * true if yes, else false */ - public function check($str) { //no default behaviour } @@ -170,10 +167,9 @@ public function check($str) { * @param array $array * The roles to check. * - * @return boolean + * @return bool * true if yes, else false */ - public function checkGroupRole($array) { return FALSE; } @@ -184,8 +180,6 @@ public function checkGroupRole($array) { * @param string $permissionName * Name of the permission we are interested in. * - * @return string - * a comma separated list of email addresses */ public function permissionEmails($permissionName) { CRM_Core_Error::fatal("this function only works in Drupal 6 at the moment"); @@ -197,8 +191,6 @@ public function permissionEmails($permissionName) { * @param string $roleName * Name of the role we are interested in. * - * @return string - * a comma separated list of email addresses */ public function roleEmails($roleName) { CRM_Core_Error::fatal("this function only works in Drupal 6 at the moment"); diff --git a/CRM/Custom/Form/Field.php b/CRM/Custom/Form/Field.php index 9bffda7c665e..edbcbc8543ba 100644 --- a/CRM/Custom/Form/Field.php +++ b/CRM/Custom/Form/Field.php @@ -84,8 +84,6 @@ class CRM_Custom_Form_Field extends CRM_Core_Form { /** * Set variables up before form is built * - * @param null - * * @return void */ public function preProcess() { @@ -171,8 +169,6 @@ public function preProcess() { * Set default values for the form. Note that in edit/view mode * the default values are retrieved from the database * - * @param null - * * @return array * array of default values */ @@ -278,8 +274,6 @@ public function setDefaultValues() { /** * Build the form object * - * @param null - * * @return void */ public function buildQuickForm() { @@ -342,7 +336,7 @@ public function buildQuickForm() { 'option_group_id', ts('Multiple Choice Option Sets'), array( - '' => ts('- select -') + '' => ts('- select -'), ) + $optionGroups ); } @@ -351,7 +345,7 @@ public function buildQuickForm() { ts('Option Type'), $optionTypes, array( - 'onclick' => "showOptionSelect();" + 'onclick' => "showOptionSelect();", ), '
' ); @@ -901,8 +895,6 @@ public static function formRule($fields, $files, $self) { /** * Process the form * - * @param null - * * @return void */ public function postProcess() { @@ -924,7 +916,7 @@ public function postProcess() { 1, 2, 3, - 5 + 5, ))) { if (empty($params['is_searchable'])) { $params['is_search_range'] = 0; diff --git a/CRM/Custom/Form/Option.php b/CRM/Custom/Form/Option.php index ccb0e94cfd96..e91b96e535d4 100644 --- a/CRM/Custom/Form/Option.php +++ b/CRM/Custom/Form/Option.php @@ -67,8 +67,6 @@ class CRM_Custom_Form_Option extends CRM_Core_Form { /** * Set variables up before form is built * - * @param null - * * @return void */ public function preProcess() { @@ -103,8 +101,6 @@ public function preProcess() { * Set default values for the form. Note that in edit/view mode * the default values are retrieved from the database * - * @param null - * * @return array * array of default values */ @@ -151,8 +147,6 @@ public function setDefaultValues() { /** * Build the form object * - * @param null - * * @return void */ public function buildQuickForm() { @@ -392,8 +386,6 @@ public static function formRule($fields, $files, $form) { /** * Process the form * - * @param null - * * @return void */ public function postProcess() { @@ -425,8 +417,8 @@ public function postProcess() { } $fieldValues = array('option_group_id' => $this->_optionGroupID); - $customOption->weight = - CRM_Utils_Weight::updateOtherWeights( + $customOption->weight + = CRM_Utils_Weight::updateOtherWeights( 'CRM_Core_DAO_OptionValue', $oldWeight, $params['weight'], @@ -456,8 +448,8 @@ public function postProcess() { else { $defVal[] = $customOption->value; } - $customField->default_value = - CRM_Core_DAO::VALUE_SEPARATOR . + $customField->default_value + = CRM_Core_DAO::VALUE_SEPARATOR . implode(CRM_Core_DAO::VALUE_SEPARATOR, $defVal) . CRM_Core_DAO::VALUE_SEPARATOR; $customField->save(); @@ -471,8 +463,8 @@ public function postProcess() { } } - $customField->default_value = - CRM_Core_DAO::VALUE_SEPARATOR . + $customField->default_value + = CRM_Core_DAO::VALUE_SEPARATOR . implode(CRM_Core_DAO::VALUE_SEPARATOR, $tempVal) . CRM_Core_DAO::VALUE_SEPARATOR; $customField->save(); diff --git a/CRM/Event/Cart/Page/CheckoutAJAX.php b/CRM/Event/Cart/Page/CheckoutAJAX.php index 194f8b50fb63..da1a2395ab39 100644 --- a/CRM/Event/Cart/Page/CheckoutAJAX.php +++ b/CRM/Event/Cart/Page/CheckoutAJAX.php @@ -14,7 +14,7 @@ public function add_participant_to_cart() { $params_array = array( 'cart_id' => $cart->id, 'contact_id' => CRM_Event_Cart_Form_Cart::find_or_create_contact(), - 'event_id' => $event_id + 'event_id' => $event_id, ); //XXX security? diff --git a/CRM/Event/Form/Registration.php b/CRM/Event/Form/Registration.php index d5afd4e34173..cfe4db0805fb 100644 --- a/CRM/Event/Form/Registration.php +++ b/CRM/Event/Form/Registration.php @@ -393,8 +393,8 @@ public function preProcess() { $this->set('values', $this->_values); $this->set('fields', $this->_fields); - $this->_availableRegistrations = - CRM_Event_BAO_Participant::eventFull( + $this->_availableRegistrations + = CRM_Event_BAO_Participant::eventFull( $this->_values['event']['id'], TRUE, CRM_Utils_Array::value('has_waitlist', $this->_values['event']) ); @@ -832,7 +832,7 @@ public function confirmPostProcess($contactID = NULL, $contribution = NULL, $pay */ public static function addParticipant(&$form, $contactID) { if (empty($form->_params)) { - return; + return NULL; } $params = $form->_params; $transaction = new CRM_Core_Transaction(); @@ -879,8 +879,7 @@ public static function addParticipant(&$form, $contactID) { ), 'register_date' => ($registerDate) ? $registerDate : date('YmdHis'), 'source' => CRM_Utils_String::ellipsify( - isset($params['participant_source']) ? - CRM_Utils_Array::value('participant_source', $params) : CRM_Utils_Array::value('description', $params), + isset($params['participant_source']) ? CRM_Utils_Array::value('participant_source', $params) : CRM_Utils_Array::value('description', $params), $participantFields['participant_source']['maxlength'] ), 'fee_level' => CRM_Utils_Array::value('amount_level', $params), @@ -1290,8 +1289,8 @@ public static function validatePriceSet(&$form, $params) { $optionMaxValues[$priceFieldId][$optId] = $currentMaxValue; } else { - $optionMaxValues[$priceFieldId][$optId] = - $currentMaxValue + CRM_Utils_Array::value($optId, CRM_Utils_Array::value($priceFieldId, $optionMaxValues), 0); + $optionMaxValues[$priceFieldId][$optId] + = $currentMaxValue + CRM_Utils_Array::value($optId, CRM_Utils_Array::value($priceFieldId, $optionMaxValues), 0); } } @@ -1308,16 +1307,16 @@ public static function validatePriceSet(&$form, $params) { if ($optMax && $total > $optMax) { $errors['soldOutOptions'][] = ts('Option %1 has sold out.', array(1 => $feeBlock[$fieldId]['options'][$optId]['label'])); if ($opDbCount && ($opDbCount >= $optMax)) { - $errors[$currentParticipantNum]["price_{$fieldId}"] = - ts('Sorry, this option is currently sold out.'); + $errors[$currentParticipantNum]["price_{$fieldId}"] + = ts('Sorry, this option is currently sold out.'); } elseif (($optMax - $opDbCount) == 1) { - $errors[$currentParticipantNum]["price_{$fieldId}"] = - ts('Sorry, currently only a single seat is available for this option.', array(1 => ($optMax - $opDbCount))); + $errors[$currentParticipantNum]["price_{$fieldId}"] + = ts('Sorry, currently only a single seat is available for this option.', array(1 => ($optMax - $opDbCount))); } else { - $errors[$currentParticipantNum]["price_{$fieldId}"] = - ts('Sorry, currently only %1 seats are available for this option.', array(1 => ($optMax - $opDbCount))); + $errors[$currentParticipantNum]["price_{$fieldId}"] + = ts('Sorry, currently only %1 seats are available for this option.', array(1 => ($optMax - $opDbCount))); } } } diff --git a/CRM/Event/Form/Task/ParticipantStatus.php b/CRM/Event/Form/Task/ParticipantStatus.php index f27f0d818bd5..046e5f02381b 100644 --- a/CRM/Event/Form/Task/ParticipantStatus.php +++ b/CRM/Event/Form/Task/ParticipantStatus.php @@ -36,7 +36,7 @@ class CRM_Event_Form_Task_ParticipantStatus extends CRM_Event_Form_Task_Batch { public function buildQuickForm() { // CRM_Event_Form_Task_Batch::buildQuickForm() gets ufGroupId // from the form, so set it here to the id of the reserved profile - $dao = new CRM_Core_DAO_UFGroup; + $dao = new CRM_Core_DAO_UFGroup(); $dao->name = 'participant_status'; $dao->find(TRUE); $this->set('ufGroupId', $dao->id); @@ -45,7 +45,7 @@ public function buildQuickForm() { asort($statuses, SORT_STRING); $this->add('select', 'status_change', ts('Change All Statuses'), array( - '' => ts('- select status -') + '' => ts('- select status -'), ) + $statuses ); diff --git a/CRM/Group/Page/Group.php b/CRM/Group/Page/Group.php index df6c826064f8..e65020f9b0f2 100644 --- a/CRM/Group/Page/Group.php +++ b/CRM/Group/Page/Group.php @@ -45,7 +45,6 @@ public function getBAOName() { /** * Define action links * - * @return array * self::$_links array of action links */ public function &links() { diff --git a/CRM/Mailing/Event/BAO/Queue.php b/CRM/Mailing/Event/BAO/Queue.php index 1ed0e5491098..1546ac382ffb 100644 --- a/CRM/Mailing/Event/BAO/Queue.php +++ b/CRM/Mailing/Event/BAO/Queue.php @@ -63,8 +63,6 @@ public static function create($params) { /** * Create a security hash from the job, email and contact ids * - * @param array The ids to be hashed - * * @return int * The hash */ diff --git a/CRM/Report/Form/Contact/LoggingDetail.php b/CRM/Report/Form/Contact/LoggingDetail.php index 3422bdc2c910..ddf5cea27248 100644 --- a/CRM/Report/Form/Contact/LoggingDetail.php +++ b/CRM/Report/Form/Contact/LoggingDetail.php @@ -36,7 +36,7 @@ class CRM_Report_Form_Contact_LoggingDetail extends CRM_Logging_ReportDetail { /** */ public function __construct() { - $logging = new CRM_Logging_Schema; + $logging = new CRM_Logging_Schema(); $this->tables[] = 'civicrm_contact'; $this->tables = array_merge($this->tables, array_keys($logging->customDataLogTables())); $this->tables[] = 'civicrm_email'; diff --git a/CRM/Report/Form/Contact/Relationship.php b/CRM/Report/Form/Contact/Relationship.php index 0f67ecbff307..d8b46dc05599 100644 --- a/CRM/Report/Form/Contact/Relationship.php +++ b/CRM/Report/Form/Contact/Relationship.php @@ -223,9 +223,9 @@ public function __construct() { 'title' => ts('Relationship'), 'operatorType' => CRM_Report_Form::OP_SELECT, 'options' => array( - '' => '- any relationship type -', - ) + - CRM_Contact_BAO_Relationship::getContactRelationshipType(NULL, 'null', NULL, NULL, TRUE), + '' => '- any relationship type -', + ) + + CRM_Contact_BAO_Relationship::getContactRelationshipType(NULL, 'null', NULL, NULL, TRUE), 'type' => CRM_Utils_Type::T_INT, ), ), @@ -587,8 +587,8 @@ public function alterDisplay(&$rows) { 'reset=1&force=1&id_op=eq&id_value=' . $row['civicrm_contact_id'], $this->_absoluteUrl, $this->_id, $this->_drilldownReport ); - $rows[$rowNum]['civicrm_contact_sort_name_a'] = - $rows[$rowNum]['civicrm_contact_sort_name_a'] . ' (' . + $rows[$rowNum]['civicrm_contact_sort_name_a'] + = $rows[$rowNum]['civicrm_contact_sort_name_a'] . ' (' . $rows[$rowNum]['civicrm_contact_id'] . ')'; $rows[$rowNum]['civicrm_contact_sort_name_a_link'] = $url; $rows[$rowNum]['civicrm_contact_sort_name_a_hover'] = ts("View Contact details for this contact."); @@ -602,8 +602,8 @@ public function alterDisplay(&$rows) { 'reset=1&force=1&id_op=eq&id_value=' . $row['civicrm_contact_b_id'], $this->_absoluteUrl, $this->_id, $this->_drilldownReport ); - $rows[$rowNum]['civicrm_contact_b_sort_name_b'] = - $rows[$rowNum]['civicrm_contact_b_sort_name_b'] . ' (' . + $rows[$rowNum]['civicrm_contact_b_sort_name_b'] + = $rows[$rowNum]['civicrm_contact_b_sort_name_b'] . ' (' . $rows[$rowNum]['civicrm_contact_b_id'] . ')'; $rows[$rowNum]['civicrm_contact_b_sort_name_b_link'] = $url; $rows[$rowNum]['civicrm_contact_b_sort_name_b_hover'] = ts("View Contact details for this contact."); @@ -613,8 +613,7 @@ public function alterDisplay(&$rows) { if (array_key_exists('civicrm_relationship_relationship_id', $row) && array_key_exists('civicrm_contact_id', $row) ) { - $url = - "/civicrm/contact/view/rel?reset=1&action=update&rtype=a_b&cid=" . + $url = "/civicrm/contact/view/rel?reset=1&action=update&rtype=a_b&cid=" . $row['civicrm_contact_id'] . "&id=" . $row['civicrm_relationship_relationship_id']; $rows[$rowNum]['civicrm_relationship_relationship_id_link'] = $url; diff --git a/CRM/Report/Form/Contact/Summary.php b/CRM/Report/Form/Contact/Summary.php index 6a3ae459ccc4..cb5140fc8397 100644 --- a/CRM/Report/Form/Contact/Summary.php +++ b/CRM/Report/Form/Contact/Summary.php @@ -54,108 +54,108 @@ class CRM_Report_Form_Contact_Summary extends CRM_Report_Form { public function __construct() { $this->_autoIncludeIndexedFieldsAsOrderBys = 1; $this->_columns = array( - 'civicrm_contact' => array( - 'dao' => 'CRM_Contact_DAO_Contact', - 'fields' => array( - 'sort_name' => array( - 'title' => ts('Contact Name'), - 'required' => TRUE, - 'no_repeat' => TRUE, - ), - 'first_name' => array( - 'title' => ts('First Name'), - ), - 'middle_name' => array( - 'title' => ts('Middle Name'), - ), - 'last_name' => array( - 'title' => ts('Last Name'), - ), - 'id' => array( - 'no_display' => TRUE, - 'required' => TRUE, - ), - 'contact_type' => array( - 'title' => ts('Contact Type'), - ), - 'contact_sub_type' => array( - 'title' => ts('Contact Subtype'), - ), - 'gender_id' => array( - 'title' => ts('Gender'), - ), - 'birth_date' => array( - 'title' => ts('Birth Date'), - ), - 'age' => array( - 'title' => ts('Age'), - 'dbAlias' => 'TIMESTAMPDIFF(YEAR, contact_civireport.birth_date, CURDATE())', - ), + 'civicrm_contact' => array( + 'dao' => 'CRM_Contact_DAO_Contact', + 'fields' => array( + 'sort_name' => array( + 'title' => ts('Contact Name'), + 'required' => TRUE, + 'no_repeat' => TRUE, ), - 'filters' => array( - 'sort_name' => array('title' => ts('Contact Name')), - 'source' => array( - 'title' => ts('Contact Source'), - 'type' => CRM_Utils_Type::T_STRING, - ), - 'id' => array( - 'title' => ts('Contact ID'), - 'no_display' => TRUE, - ), - 'gender_id' => array( - 'title' => ts('Gender'), - 'operatorType' => CRM_Report_Form::OP_MULTISELECT, - 'options' => CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'gender_id'), - ), - 'birth_date' => array( - 'title' => ts('Birth Date'), - 'operatorType' => CRM_Report_Form::OP_DATE, - ), + 'first_name' => array( + 'title' => ts('First Name'), ), - 'grouping' => 'contact-fields', - 'order_bys' => array( - 'sort_name' => array( - 'title' => ts('Last Name, First Name'), - 'default' => '1', - 'default_weight' => '0', - 'default_order' => 'ASC', - ), - 'gender_id' => array( - 'name' => 'gender_id', - 'title' => ts('Gender'), - ), - 'birth_date' => array( - 'name' => 'birth_date', - 'title' => ts('Birth Date'), - ), + 'middle_name' => array( + 'title' => ts('Middle Name'), + ), + 'last_name' => array( + 'title' => ts('Last Name'), + ), + 'id' => array( + 'no_display' => TRUE, + 'required' => TRUE, + ), + 'contact_type' => array( + 'title' => ts('Contact Type'), + ), + 'contact_sub_type' => array( + 'title' => ts('Contact Subtype'), + ), + 'gender_id' => array( + 'title' => ts('Gender'), + ), + 'birth_date' => array( + 'title' => ts('Birth Date'), + ), + 'age' => array( + 'title' => ts('Age'), + 'dbAlias' => 'TIMESTAMPDIFF(YEAR, contact_civireport.birth_date, CURDATE())', ), ), - 'civicrm_email' => array( - 'dao' => 'CRM_Core_DAO_Email', - 'fields' => array( - 'email' => array( - 'title' => ts('Email'), - 'no_repeat' => TRUE, - ), + 'filters' => array( + 'sort_name' => array('title' => ts('Contact Name')), + 'source' => array( + 'title' => ts('Contact Source'), + 'type' => CRM_Utils_Type::T_STRING, + ), + 'id' => array( + 'title' => ts('Contact ID'), + 'no_display' => TRUE, + ), + 'gender_id' => array( + 'title' => ts('Gender'), + 'operatorType' => CRM_Report_Form::OP_MULTISELECT, + 'options' => CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'gender_id'), ), - 'grouping' => 'contact-fields', - 'order_bys' => array( - 'email' => array( - 'title' => ts('Email'), - ), + 'birth_date' => array( + 'title' => ts('Birth Date'), + 'operatorType' => CRM_Report_Form::OP_DATE, + ), + ), + 'grouping' => 'contact-fields', + 'order_bys' => array( + 'sort_name' => array( + 'title' => ts('Last Name, First Name'), + 'default' => '1', + 'default_weight' => '0', + 'default_order' => 'ASC', + ), + 'gender_id' => array( + 'name' => 'gender_id', + 'title' => ts('Gender'), + ), + 'birth_date' => array( + 'name' => 'birth_date', + 'title' => ts('Birth Date'), + ), + ), + ), + 'civicrm_email' => array( + 'dao' => 'CRM_Core_DAO_Email', + 'fields' => array( + 'email' => array( + 'title' => ts('Email'), + 'no_repeat' => TRUE, + ), + ), + 'grouping' => 'contact-fields', + 'order_bys' => array( + 'email' => array( + 'title' => ts('Email'), ), ), - 'civicrm_phone' => array( - 'dao' => 'CRM_Core_DAO_Phone', - 'fields' => array( - 'phone' => NULL, - 'phone_ext' => array( - 'title' => ts('Phone Extension'), - ), + ), + 'civicrm_phone' => array( + 'dao' => 'CRM_Core_DAO_Phone', + 'fields' => array( + 'phone' => NULL, + 'phone_ext' => array( + 'title' => ts('Phone Extension'), ), - 'grouping' => 'contact-fields', ), - ) + $this->getAddressColumns(array('group_by' => FALSE)); + 'grouping' => 'contact-fields', + ), + ) + $this->getAddressColumns(array('group_by' => FALSE)); $this->_groupFilter = TRUE; $this->_tagFilter = TRUE; diff --git a/CRM/Upgrade/Incremental/php/FourTwo.php b/CRM/Upgrade/Incremental/php/FourTwo.php index b2cf8f1448a0..8f91366a4ec0 100644 --- a/CRM/Upgrade/Incremental/php/FourTwo.php +++ b/CRM/Upgrade/Incremental/php/FourTwo.php @@ -188,7 +188,7 @@ public function upgrade_4_2_alpha1($rev) { } } // Drop index UI_title for civicrm_price_set - $domain = new CRM_Core_DAO_Domain; + $domain = new CRM_Core_DAO_Domain(); $domain->find(TRUE); if ($domain->locales) { $locales = explode(CRM_Core_DAO::VALUE_SEPARATOR, $domain->locales); @@ -285,7 +285,7 @@ public function upgrade_4_2_2($rev) { $dao = CRM_Core_DAO::executeQuery($query); if (!$dao->N) { - $domain = new CRM_Core_DAO_Domain; + $domain = new CRM_Core_DAO_Domain(); $domain->find(TRUE); if ($domain->locales) { @@ -433,7 +433,7 @@ public static function task_4_2_alpha1_createPriceSets(CRM_Queue_TaskContext $ct $addTo[2] = $dao->contribution_page_id; $options = array( 'otherAmount' => $dao->is_allow_other_amount, - 'membership' => $dao->membership_block_id + 'membership' => $dao->membership_block_id, ); self::createPriceSet($daoName, $addTo, $options); } @@ -655,7 +655,7 @@ public static function task_4_2_alpha1_convertContributions(CRM_Queue_TaskContex '2' => array('membership_amount', 'String'), '3' => array( CRM_Core_DAO::getFieldValue('CRM_Member_DAO_Membership', $result->membership_id, 'membership_type_id'), - 'Integer' + 'Integer', ), ); $res = CRM_Core_DAO::executeQuery($sql, $params); @@ -721,12 +721,12 @@ public static function task_4_2_alpha1_convertContributions(CRM_Queue_TaskContex if (!empty($defaults)) { $lineParams['price_field_id'] = $defaults['id']; $lineParams['label'] = $defaults['label']; - $lineParams['price_field_value_id'] = - CRM_Core_DAO::getFieldValue('CRM_Upgrade_Snapshot_V4p2_Price_DAO_FieldValue', $defaults['id'], 'id', 'price_field_id'); + $lineParams['price_field_value_id'] + = CRM_Core_DAO::getFieldValue('CRM_Upgrade_Snapshot_V4p2_Price_DAO_FieldValue', $defaults['id'], 'id', 'price_field_id'); } else { - $lineParams['price_field_id'] = - CRM_Core_DAO::getFieldValue('CRM_Upgrade_Snapshot_V4p2_Price_DAO_Field', $priceSetId, 'id', 'price_set_id'); + $lineParams['price_field_id'] + = CRM_Core_DAO::getFieldValue('CRM_Upgrade_Snapshot_V4p2_Price_DAO_Field', $priceSetId, 'id', 'price_set_id'); $lineParams['label'] = 'Contribution Amount'; } $lineParams['qty'] = 1; @@ -967,7 +967,7 @@ public static function deleteInvalidPairs() { $dao->start_date, $dao->end_date, $memStatus, - $status + $status, ); } } diff --git a/CRM/Utils/Migrate/ExportJSON.php b/CRM/Utils/Migrate/ExportJSON.php index 4cda5c0e1ce2..6d7e589a2b6c 100644 --- a/CRM/Utils/Migrate/ExportJSON.php +++ b/CRM/Utils/Migrate/ExportJSON.php @@ -185,7 +185,7 @@ public function optionGroup($optionGroupVars) { * @param $whereField * @param null $additionalWhereCond */ - function table( + public function table( &$ids, $tableName, &$fields, @@ -590,7 +590,7 @@ public function export(&$contactIDs) { * @param null $lastExportTime * @param bool $discoverContacts */ - function run( + public function run( $fileName, $lastExportTime = NULL, $discoverContacts = FALSE diff --git a/CRM/Utils/Money.php b/CRM/Utils/Money.php index 4bb167244157..916c892938c7 100644 --- a/CRM/Utils/Money.php +++ b/CRM/Utils/Money.php @@ -90,7 +90,7 @@ public static function format($amount, $currency = NULL, $format = NULL, $onlyNu if (!self::$_currencySymbols) { self::$_currencySymbols = CRM_Core_PseudoConstant::get('CRM_Contribute_DAO_Contribution', 'currency', array( 'keyColumn' => 'name', - 'labelColumn' => 'symbol' + 'labelColumn' => 'symbol', )); } diff --git a/Civi/Core/Container.php b/Civi/Core/Container.php index 000143abde1a..fa56a554c7ff 100644 --- a/Civi/Core/Container.php +++ b/Civi/Core/Container.php @@ -100,7 +100,7 @@ public function createEventDispatcher() { $dispatcher->addListener('DAO::post-delete', array('\CRM_Core_BAO_RecurringEntity', 'triggerDelete')); $dispatcher->addListener('hook_civicrm_unhandled_exception', array( 'CRM_Core_LegacyErrorHandler', - 'handleException' + 'handleException', )); return $dispatcher; } diff --git a/api/v3/Mailing.php b/api/v3/Mailing.php index 7bc6be0ae629..f85074236ae2 100755 --- a/api/v3/Mailing.php +++ b/api/v3/Mailing.php @@ -41,7 +41,7 @@ * * @param array $params * @return array API Success Array - * API Success Array + * API Success Array * @throws \API_Exception * @throws \Civi\API\Exception\UnauthorizedException */ @@ -206,7 +206,7 @@ function civicrm_api3_mailing_event_bounce($params) { return civicrm_api3_create_success($params); } else { - throw new API_Exception(ts('Queue event could not be found'),'no_queue_event + throw new API_Exception(ts('Queue event could not be found'), 'no_queue_event '); } } @@ -573,31 +573,31 @@ function civicrm_api3_mailing_stats($params) { switch ($detail) { case 'Delivered': $stats[$params['mailing_id']] += array( - $detail => CRM_Mailing_Event_BAO_Delivered::getTotalCount($params['mailing_id'], $params['job_id'], FALSE, $params['date']), + $detail => CRM_Mailing_Event_BAO_Delivered::getTotalCount($params['mailing_id'], $params['job_id'], FALSE, $params['date']), ); break; case 'Bounces': $stats[$params['mailing_id']] += array( - $detail => CRM_Mailing_Event_BAO_Bounce::getTotalCount($params['mailing_id'], $params['job_id'], FALSE, $params['date']), + $detail => CRM_Mailing_Event_BAO_Bounce::getTotalCount($params['mailing_id'], $params['job_id'], FALSE, $params['date']), ); break; case 'Unsubscribers': $stats[$params['mailing_id']] += array( - $detail => CRM_Mailing_Event_BAO_Unsubscribe::getTotalCount($params['mailing_id'], $params['job_id'], FALSE, NULL, $params['date']), + $detail => CRM_Mailing_Event_BAO_Unsubscribe::getTotalCount($params['mailing_id'], $params['job_id'], FALSE, NULL, $params['date']), ); break; case 'Unique Clicks': $stats[$params['mailing_id']] += array( - $detail => CRM_Mailing_Event_BAO_TrackableURLOpen::getTotalCount($params['mailing_id'], $params['job_id'], FALSE, NULL, $params['date']), + $detail => CRM_Mailing_Event_BAO_TrackableURLOpen::getTotalCount($params['mailing_id'], $params['job_id'], FALSE, NULL, $params['date']), ); break; case 'Opened': $stats[$params['mailing_id']] += array( - $detail => CRM_Mailing_Event_BAO_Opened::getTotalCount($params['mailing_id'], $params['job_id'], FALSE, $params['date']), + $detail => CRM_Mailing_Event_BAO_Opened::getTotalCount($params['mailing_id'], $params['job_id'], FALSE, $params['date']), ); break; } diff --git a/api/v3/Membership.php b/api/v3/Membership.php index d16aff5ec8ad..dfc3ca78d710 100644 --- a/api/v3/Membership.php +++ b/api/v3/Membership.php @@ -46,7 +46,7 @@ * * @return array * api result - * {@getfields membership_delete} + * {@getfields membership_delete} */ function civicrm_api3_membership_delete($params) { return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params); @@ -63,7 +63,7 @@ function civicrm_api3_membership_delete($params) { * * @return array * Array of newly created membership property values. - * {@getfields membership_create} + * {@getfields membership_create} */ function civicrm_api3_membership_create($params) { // check params for membership id during update @@ -112,10 +112,10 @@ function civicrm_api3_membership_create($params) { // Fixme: This code belongs in the BAO $action = CRM_Core_Action::ADD; // we need user id during add mode - $ids = array(); - if (!empty($params['contact_id'])) { - $ids['userId'] = $params['contact_id']; - } + $ids = array(); + if (!empty($params['contact_id'])) { + $ids['userId'] = $params['contact_id']; + } //for edit membership id should be present if (!empty($params['id'])) { $ids['membership'] = $params['id']; @@ -202,7 +202,7 @@ function civicrm_api3_membership_get($params) { $params['status_id'] = array('IN' => CRM_Member_BAO_MembershipStatus::getMembershipStatusCurrent()); } - $options = _civicrm_api3_get_options_from_params($params, TRUE,'membership', 'get'); + $options = _civicrm_api3_get_options_from_params($params, TRUE, 'membership', 'get'); if ($options['is_count']) { return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params); } @@ -218,7 +218,7 @@ function civicrm_api3_membership_get($params) { return civicrm_api3_create_success($membershipValues, $params, 'membership', 'get'); } - $members = _civicrm_api3_membership_relationsship_get_customv2behaviour($params, $membershipValues, $contactID); + $members = _civicrm_api3_membership_relationsship_get_customv2behaviour($params, $membershipValues, $contactID); return civicrm_api3_create_success($members, $params, 'membership', 'get'); } diff --git a/settings/Developer.setting.php b/settings/Developer.setting.php index c9c31e33e1fa..132090d2dc0f 100644 --- a/settings/Developer.setting.php +++ b/settings/Developer.setting.php @@ -66,8 +66,7 @@ 'is_contact' => 0, 'description' => "Set this value to Yes if you want CiviCRM error/debugging messages to also appear in Drupal error logs", 'prefetch' => 1, - 'help_text' => "Set this value to Yes if you want CiviCRM error/debugging messages the appear in your CMS' error log. -In the case of Drupal, this will cause all CiviCRM error messages to appear in the watchdog (assuming you have Drupal's watchdog enabled)", + 'help_text' => "Set this value to Yes if you want CiviCRM error/debugging messages the appear in your CMS' error log. In the case of Drupal, this will cause all CiviCRM error messages to appear in the watchdog (assuming you have Drupal's watchdog enabled)", ), 'backtrace' => array( 'group_name' => 'Developer Preferences', diff --git a/tests/phpunit/CRM/AllTests.php b/tests/phpunit/CRM/AllTests.php index c63f8c95c08b..f910defe84ef 100644 --- a/tests/phpunit/CRM/AllTests.php +++ b/tests/phpunit/CRM/AllTests.php @@ -47,7 +47,7 @@ class CRM_AllTests extends CiviTestSuite { */ private static function getInstance() { if (is_null(self::$instance)) { - self::$instance = new self; + self::$instance = new self(); } return self::$instance; } diff --git a/tests/phpunit/CiviTest/CiviDBAssert.php b/tests/phpunit/CiviTest/CiviDBAssert.php index ff1296074617..dc056dbc1c14 100644 --- a/tests/phpunit/CiviTest/CiviDBAssert.php +++ b/tests/phpunit/CiviTest/CiviDBAssert.php @@ -150,7 +150,7 @@ public function assertDBRowNotExist(&$testCase, $daoName, $id, $message) { * @param $expectedValue * @param string $message */ - function assertDBCompareValue( + public function assertDBCompareValue( &$testCase, $daoName, $searchValue, $returnColumn, $searchColumn, $expectedValue, $message ) { diff --git a/tests/phpunit/WebTest/Profile/DedupeTest.php b/tests/phpunit/WebTest/Profile/DedupeTest.php index 00e69530be6b..accd8a4faa70 100644 --- a/tests/phpunit/WebTest/Profile/DedupeTest.php +++ b/tests/phpunit/WebTest/Profile/DedupeTest.php @@ -41,7 +41,7 @@ public function testProfileCreateDupeStrictDefault() { 'edit-1-profile-create', 'edit-1-profile-edit', 'edit-1-profile-listings', - 'edit-1-profile-view' + 'edit-1-profile-view', ); $this->changePermissions($permission); diff --git a/tests/phpunit/api/v3/PledgeTest.php b/tests/phpunit/api/v3/PledgeTest.php index 55c452bcad62..d1873c6b1204 100644 --- a/tests/phpunit/api/v3/PledgeTest.php +++ b/tests/phpunit/api/v3/PledgeTest.php @@ -101,8 +101,6 @@ public function testCreateWithCustom() { $this->customGroupDelete($ids['custom_group_id']); } - /* - */ public function testgetfieldspledge() { $result = $this->callAPISuccess('pledge', 'getfields', array('action' => 'get')); $this->assertEquals(1, $result['values']['next_pay_date']['api.return']); @@ -184,7 +182,7 @@ public function testPledgeGetReturnFilters() { $this->assertEquals($oldPledge['id'], $earlyPledge['id'], ' check correct pledge returned ' . __LINE__); } - /* + /** * create 2 pledges - see if we can get by status id */ public function testGetOverduePledge() { @@ -207,7 +205,7 @@ public function testGetOverduePledge() { } - /* + /** * create 2 pledges - see if we can get by status id */ public function testSortParamPledge() { @@ -264,7 +262,7 @@ public function testCreatePledge() { $pledge = $this->callAPISuccess('pledge', 'delete', $pledgeID); } - /* + /** * Test that pledge with weekly schedule calculates dates correctly */ public function testCreatePledgeWeeklySchedule() { @@ -279,7 +277,7 @@ public function testCreatePledgeWeeklySchedule() { //ensure that correct number of payments created & last payment has the right date $payments = $this->callAPISuccess('PledgePayment', 'Get', array( 'pledge_id' => $pledge['id'], - 'sequential' => 1 + 'sequential' => 1, )); $this->assertEquals($payments['count'], 5, 'In line ' . __LINE__); $this->assertEquals('2011-07-06 00:00:00', $payments['values'][4]['scheduled_date'], 'In line ' . __LINE__); @@ -331,10 +329,10 @@ public function testCreatePledgeSinglePayment() { $pledge = $this->callAPISuccess('pledge', 'delete', $pledgeID); } - /* - * test that using original_installment_amount rather than pledge_original_installment_amount works - * Pledge field behaviour is a bit random & so pledge has come to try to handle both unique & non -unique fields - */ + /** + * test that using original_installment_amount rather than pledge_original_installment_amount works + * Pledge field behaviour is a bit random & so pledge has come to try to handle both unique & non -unique fields + */ public function testCreatePledgeWithNonUnique() { $params = $this->_params; $params['original_installment_amount'] = $params['pledge_original_installment_amount']; @@ -468,7 +466,6 @@ public function testCreateUpdatePledgeLegacy() { $pledge = $this->callAPISuccess('pledge', 'delete', $new_params); } - ///////////////// civicrm_pledge_delete methods public function testDeleteEmptyParamsPledge() { $pledge = $this->callAPIFailure('pledge', 'delete', array(), 'Mandatory key(s) missing from params array: id'); }