From: Tim Otten Date: Fri, 9 Jan 2015 03:53:01 +0000 (-0800) Subject: INFRA-132 - CRM/ - Fix misc oddball syntax X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=d3e86119e2d61c80659f819e20e62a500a14d469;p=civicrm-core.git INFRA-132 - CRM/ - Fix misc oddball syntax --- diff --git a/CRM/ACL/BAO/Cache.php b/CRM/ACL/BAO/Cache.php index da9c7210a0..56c8bd5d01 100644 --- a/CRM/ACL/BAO/Cache.php +++ b/CRM/ACL/BAO/Cache.php @@ -140,7 +140,9 @@ WHERE contact_id = %1 CRM_Contact_BAO_Contact_Permission::cache($id, CRM_Core_Permission::VIEW, TRUE); } - // deletes all the cache entries + /** + * Deletes all the cache entries. + */ public static function resetCache() { // reset any static caching self::$_cache = NULL; diff --git a/CRM/Activity/BAO/Activity.php b/CRM/Activity/BAO/Activity.php index 00d06152c2..c7b43a3214 100644 --- a/CRM/Activity/BAO/Activity.php +++ b/CRM/Activity/BAO/Activity.php @@ -2593,7 +2593,7 @@ INNER JOIN civicrm_option_group grp ON ( grp.id = val.option_group_id AND grp.n /** * Used to copy custom fields and attachments from an existing activity to another. - * @see CRM_Case_Page_AJAX::_convertToCaseActivity() for example + * @see CRM_Case_Page_AJAX::_convertToCaseActivity() * * @param array $params */ diff --git a/CRM/Contact/BAO/Contact.php b/CRM/Contact/BAO/Contact.php index afdee2970b..b5b11cc6c8 100644 --- a/CRM/Contact/BAO/Contact.php +++ b/CRM/Contact/BAO/Contact.php @@ -985,9 +985,9 @@ WHERE id={$id}; "; * Validate type of contact image * * @param array $params - * @param String $imageIndex + * @param string $imageIndex * Index of image field. - * @param String $statusMsg + * @param string $statusMsg * Status message to be set after operation. * @param string $opType * Type of operation like fatal, bounce etc. @@ -1052,8 +1052,10 @@ WHERE id={$id}; "; /** * Function to set is_delete true or restore deleted contact * - * @param int $contact Contact DAO object - * @param boolean $restore true to set the is_delete = 1 else false to restore deleted contact, + * @param int $contact + * Contact DAO object. + * @param bool $restore + * True to set the is_delete = 1 else false to restore deleted contact, * i.e. is_delete = 0 * * @return void diff --git a/CRM/Contact/BAO/Contact/Utils.php b/CRM/Contact/BAO/Contact/Utils.php index a5beebd286..45ae2c083d 100644 --- a/CRM/Contact/BAO/Contact/Utils.php +++ b/CRM/Contact/BAO/Contact/Utils.php @@ -471,8 +471,8 @@ WHERE id={$contactId}; "; if ($relationship->find(TRUE)) { CRM_Contact_BAO_Relationship::setIsActive($relationship->id, FALSE); CRM_Contact_BAO_Relationship::relatedMemberships($contactId, $relMembershipParams, - $ids = array( - ), CRM_Core_Action::DELETE + $ids = array(), + CRM_Core_Action::DELETE ); } $relationship->free(); diff --git a/CRM/Contact/BAO/Group.php b/CRM/Contact/BAO/Group.php index 848f5d1fa2..15dcf89f68 100644 --- a/CRM/Contact/BAO/Group.php +++ b/CRM/Contact/BAO/Group.php @@ -720,8 +720,8 @@ class CRM_Contact_BAO_Group extends CRM_Contact_DAO_Group { * @return array $groupList associated array of group list * -rp = rowcount * -page= offset - * @todo there seems little reason for the small number of functions that call this to pass in - * params that then need to be translated in this function since they are coding them when calling + * @todo there seems little reason for the small number of functions that call this to pass in + * params that then need to be translated in this function since they are coding them when calling */ static public function getGroupListSelector(&$params) { // format the params diff --git a/CRM/Contact/BAO/ProximityQuery.php b/CRM/Contact/BAO/ProximityQuery.php index 83226594c0..f6106a189b 100644 --- a/CRM/Contact/BAO/ProximityQuery.php +++ b/CRM/Contact/BAO/ProximityQuery.php @@ -328,7 +328,7 @@ ACOS( $query->_tables['civicrm_address'] = $query->_whereTables['civicrm_address'] = 1; - require_once (str_replace('_', DIRECTORY_SEPARATOR, $fnName) . '.php'); + require_once str_replace('_', DIRECTORY_SEPARATOR, $fnName) . '.php'; $fnName::format($proximityAddress); if ( !is_numeric(CRM_Utils_Array::value('geo_code_1', $proximityAddress)) || diff --git a/CRM/Contact/BAO/SearchCustom.php b/CRM/Contact/BAO/SearchCustom.php index 29752582e4..fd7d6e3779 100644 --- a/CRM/Contact/BAO/SearchCustom.php +++ b/CRM/Contact/BAO/SearchCustom.php @@ -91,7 +91,7 @@ class CRM_Contact_BAO_SearchCustom { $customSearchClass = $ext->keyToClass($customSearchClass); } - $error = include_once ($customSearchFile); + $error = include_once $customSearchFile; if ($error == FALSE) { CRM_Core_Error::fatal('Custom search file: ' . $customSearchFile . ' does not exist. Please verify your custom search settings in CiviCRM administrative panel.'); } diff --git a/CRM/Contact/Form/CustomData.php b/CRM/Contact/Form/CustomData.php index d863505cb0..ade28593a0 100644 --- a/CRM/Contact/Form/CustomData.php +++ b/CRM/Contact/Form/CustomData.php @@ -186,7 +186,7 @@ class CRM_Contact_Form_CustomData extends CRM_Core_Form { ); if ($isMultiple) { $this->assign('multiRecordDisplay', $this->_multiRecordDisplay); - $saveButtonName = $this->_copyValueId ? 'Save a Copy': 'Save'; + $saveButtonName = $this->_copyValueId ? 'Save a Copy' : 'Save'; $this->addButtons(array( array( 'type' => 'upload', diff --git a/CRM/Contact/Form/Edit/Address.php b/CRM/Contact/Form/Edit/Address.php index b1bb21a159..c3885983d1 100644 --- a/CRM/Contact/Form/Edit/Address.php +++ b/CRM/Contact/Form/Edit/Address.php @@ -235,8 +235,7 @@ class CRM_Contact_Form_Edit_Address { $template = CRM_Core_Smarty::singleton(); $tplGroupTree = $template->get_template_vars('address_groupTree'); - $tplGroupTree = empty($tplGroupTree) ? array( - ) : $tplGroupTree; + $tplGroupTree = empty($tplGroupTree) ? array() : $tplGroupTree; $form->assign('address_groupTree', $tplGroupTree + array($blockId => $groupTree)); // unset the temp smarty var that got created diff --git a/CRM/Contact/Form/Location.php b/CRM/Contact/Form/Location.php index 6d6363c13c..2c8f35a39e 100644 --- a/CRM/Contact/Form/Location.php +++ b/CRM/Contact/Form/Location.php @@ -87,7 +87,7 @@ class CRM_Contact_Form_Location { //build 1 instance of all blocks, without using ajax ... foreach ($form->_blocks as $blockName => $label) { - require_once (str_replace('_', DIRECTORY_SEPARATOR, 'CRM_Contact_Form_Edit_' . $blockName) . '.php'); + require_once str_replace('_', DIRECTORY_SEPARATOR, 'CRM_Contact_Form_Edit_' . $blockName) . '.php'; $name = strtolower($blockName); $instances = array(1); diff --git a/CRM/Contact/Form/Relationship.php b/CRM/Contact/Form/Relationship.php index 1ee6aadd0c..e3f0e7e57f 100644 --- a/CRM/Contact/Form/Relationship.php +++ b/CRM/Contact/Form/Relationship.php @@ -262,7 +262,7 @@ class CRM_Contact_Form_Relationship extends CRM_Core_Form { 'limit' => 1, 'version' => 3, ); - $note = civicrm_api('Note' ,'getsingle', $noteParams); + $note = civicrm_api('Note', 'getsingle', $noteParams); $defaults['note'] = CRM_Utils_Array::value('note', $note); } } @@ -486,7 +486,7 @@ class CRM_Contact_Form_Relationship extends CRM_Core_Form { 'entity_id' => $id, 'entity_table' => 'civicrm_relationship', ); - $existing = civicrm_api3('note' ,'get', $noteParams); + $existing = civicrm_api3('note', 'get', $noteParams); if (!empty($existing['id'])) { $noteParams['id'] = $existing['id']; } diff --git a/CRM/Contact/Form/Search.php b/CRM/Contact/Form/Search.php index 964cc5c95b..ef4560524d 100644 --- a/CRM/Contact/Form/Search.php +++ b/CRM/Contact/Form/Search.php @@ -807,7 +807,7 @@ class CRM_Contact_Form_Search extends CRM_Core_Form_Search { $setDynamic = TRUE; } else { - $selector = new self::$_selectorName ( + $selector = new self::$_selectorName( $this->_params, $this->_action, NULL, diff --git a/CRM/Contact/Form/Task.php b/CRM/Contact/Form/Task.php index 9329af659d..0e728ef1e4 100644 --- a/CRM/Contact/Form/Task.php +++ b/CRM/Contact/Form/Task.php @@ -291,7 +291,7 @@ class CRM_Contact_Form_Task extends CRM_Core_Form { } $selectorName = $this->controller->selectorName(); - require_once(str_replace('_', DIRECTORY_SEPARATOR, $selectorName) . '.php'); + require_once str_replace('_', DIRECTORY_SEPARATOR, $selectorName) . '.php'; $fv = $this->get('formValues'); $customClass = $this->get('customSearchClass'); diff --git a/CRM/Contact/Form/Task/EmailCommon.php b/CRM/Contact/Form/Task/EmailCommon.php index d1afbf7315..9b490f6939 100644 --- a/CRM/Contact/Form/Task/EmailCommon.php +++ b/CRM/Contact/Form/Task/EmailCommon.php @@ -383,7 +383,7 @@ class CRM_Contact_Form_Task_EmailCommon { $ccValues['details'][] = "" . $form->_contactDetails[$contactId]['display_name'] . ""; break; case 'bcc_id': - $bccValues['email'][]= '"' . $form->_contactDetails[$contactId]['sort_name'] . '" <' . $email . '>'; + $bccValues['email'][] = '"' . $form->_contactDetails[$contactId]['sort_name'] . '" <' . $email . '>'; $bccValues['details'][] = "" . $form->_contactDetails[$contactId]['display_name'] . ""; break; } diff --git a/CRM/Contact/Form/Task/Print.php b/CRM/Contact/Form/Task/Print.php index 75428d14a8..11747d38b8 100644 --- a/CRM/Contact/Form/Task/Print.php +++ b/CRM/Contact/Form/Task/Print.php @@ -81,7 +81,7 @@ class CRM_Contact_Form_Task_Print extends CRM_Contact_Form_Task { } $selectorName = $this->controller->selectorName(); - require_once (str_replace('_', DIRECTORY_SEPARATOR, $selectorName) . '.php'); + require_once str_replace('_', DIRECTORY_SEPARATOR, $selectorName) . '.php'; $returnP = isset($returnPropeties) ? $returnPropeties : ""; $customSearchClass = $this->get('customSearchClass'); diff --git a/CRM/Contribute/BAO/Query.php b/CRM/Contribute/BAO/Query.php index afec1c9728..c90cffea90 100644 --- a/CRM/Contribute/BAO/Query.php +++ b/CRM/Contribute/BAO/Query.php @@ -1151,7 +1151,7 @@ class CRM_Contribute_BAO_Query { } // we only have recurring dates using this ATM so lets' short cut to find the table name $table = 'contribution_recur'; - $fieldName = split($table . '_', $field); + $fieldName = explode($table . '_', $field); $query->dateQueryBuilder($values, 'civicrm_' . $table, $field, $fieldName[1], $title ); diff --git a/CRM/Contribute/Exception/InactiveContributionPageException.php b/CRM/Contribute/Exception/InactiveContributionPageException.php index 2c8273dcb0..788ac732c4 100644 --- a/CRM/Contribute/Exception/InactiveContributionPageException.php +++ b/CRM/Contribute/Exception/InactiveContributionPageException.php @@ -5,8 +5,7 @@ * Date: 8/12/2014 * Time: 10:33 AM */ - -class CRM_Contribute_Exception_InactiveContributionPageException extends Exception{ +class CRM_Contribute_Exception_InactiveContributionPageException extends Exception { private $id; public function __construct($message, $id) { parent::__construct(ts($message)); diff --git a/CRM/Contribute/Form/Contribution.php b/CRM/Contribute/Form/Contribution.php index affb8d2e2d..6eac14fc75 100644 --- a/CRM/Contribute/Form/Contribution.php +++ b/CRM/Contribute/Form/Contribution.php @@ -1000,7 +1000,7 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP */ public function postProcess() { $sendReceipt = $pId = $contribution = $isRelatedId = FALSE; - $softParams = $softIDs =array(); + $softParams = $softIDs = array(); if ($this->_action & CRM_Core_Action::DELETE) { CRM_Contribute_BAO_Contribution::deleteContribution($this->_id); @@ -1116,7 +1116,7 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP $submittedValues['tax_amount'] = 'null'; } if ($lineItems[$itemId]['tax_rate']) { - $lineItems[$itemId]['tax_amount'] = ($lineItems[$itemId]['tax_rate']/100) * $lineItems[$itemId]['line_total']; + $lineItems[$itemId]['tax_amount'] = ($lineItems[$itemId]['tax_rate'] / 100) * $lineItems[$itemId]['line_total']; $submittedValues['total_amount'] = $lineItems[$itemId]['line_total'] + $lineItems[$itemId]['tax_amount']; $submittedValues['tax_amount'] = $lineItems[$itemId]['tax_amount']; } diff --git a/CRM/Contribute/Form/Contribution/Confirm.php b/CRM/Contribute/Form/Contribution/Confirm.php index bda9b01a8b..b1e1be6db5 100644 --- a/CRM/Contribute/Form/Contribution/Confirm.php +++ b/CRM/Contribute/Form/Contribution/Confirm.php @@ -1123,7 +1123,7 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr if ($fixed_period_start_day) { $date = explode('-', date('Y-m-d')); $month = substr($fixed_period_start_day, 0, strlen($fixed_period_start_day) - 2); - $day = substr($fixed_period_start_day, -2) . "
"; + $day = substr($fixed_period_start_day, -2) . "
"; $year = $date[0]; $startDate = $year . '-' . $month . '-' . $day; } diff --git a/CRM/Contribute/Form/Task/PDFLetterCommon.php b/CRM/Contribute/Form/Task/PDFLetterCommon.php index ec4b55adfe..99b6c5f92b 100644 --- a/CRM/Contribute/Form/Task/PDFLetterCommon.php +++ b/CRM/Contribute/Form/Task/PDFLetterCommon.php @@ -76,7 +76,7 @@ class CRM_Contribute_Form_Task_PDFLetterCommon extends CRM_Contact_Form_Task_PDF $contact['is_sent'][$groupBy][$groupByID] = TRUE; if (!empty($formValues['email_options'])) { if (self::emailLetter($contact, $html[$contributionId], $isPDF, $formValues, $emailParams)) { - $emailed ++; + $emailed++; if (!stristr($formValues['email_options'], 'both')) { unset($html[$contributionId]); } diff --git a/CRM/Contribute/Import/Field.php b/CRM/Contribute/Import/Field.php index 535b5fd75c..c55d4e7371 100644 --- a/CRM/Contribute/Import/Field.php +++ b/CRM/Contribute/Import/Field.php @@ -176,7 +176,7 @@ class CRM_Contribute_Import_Field { else { return FALSE; } - break; + break; case 'payment_instrument': static $paymentInstruments = NULL; diff --git a/CRM/Core/BAO/FinancialTrxn.php b/CRM/Core/BAO/FinancialTrxn.php index ed988c535a..2a8e0a3dd6 100644 --- a/CRM/Core/BAO/FinancialTrxn.php +++ b/CRM/Core/BAO/FinancialTrxn.php @@ -205,7 +205,7 @@ WHERE ft.entity_table = 'civicrm_contribution' AND ft.entity_id = %1 "; $sqlParams = array(1 => array($entity_id, 'Integer')); - return CRM_Core_DAO::singleValueQuery($query, $sqlParams); + return CRM_Core_DAO::singleValueQuery($query, $sqlParams); } @@ -328,7 +328,7 @@ WHERE ceft.entity_id = %1"; $financialAccountType = CRM_Contribute_PseudoConstant::financialAccountType($params['financial_type_id']); $accountRelationship = CRM_Core_PseudoConstant::accountOptionValues('account_relationship', NULL, " AND label IN ('Premiums Inventory Account is', 'Cost of Sales Account is')"); $toFinancialAccount = !empty($params['isDeleted']) ? 'Premiums Inventory Account is' : 'Cost of Sales Account is'; - $fromFinancialAccount = !empty($params['isDeleted']) ? 'Cost of Sales Account is': 'Premiums Inventory Account is'; + $fromFinancialAccount = !empty($params['isDeleted']) ? 'Cost of Sales Account is' : 'Premiums Inventory Account is'; $accountRelationship = array_flip($accountRelationship); $financialtrxn = array( 'to_financial_account_id' => $financialAccountType[$accountRelationship[$toFinancialAccount]], diff --git a/CRM/Core/BAO/LabelFormat.php b/CRM/Core/BAO/LabelFormat.php index 0ecd262fd0..16d7145826 100644 --- a/CRM/Core/BAO/LabelFormat.php +++ b/CRM/Core/BAO/LabelFormat.php @@ -178,7 +178,7 @@ class CRM_Core_BAO_LabelFormat extends CRM_Core_DAO_OptionValue { * @return array array of font names * @static */ - public static function getFontNames($name='label_format') { + public static function getFontNames($name = 'label_format') { $label = new CRM_Utils_PDF_Label(self::getDefaultValues($name)); return $label->getFontNames(); } @@ -256,7 +256,7 @@ class CRM_Core_BAO_LabelFormat extends CRM_Core_DAO_OptionValue { * * @return int Group ID (null if Group ID doesn't exist) */ - private static function _getGid($name='label_format') { + private static function _getGid($name = 'label_format') { if (!isset(self::$_gid[$name]) || !self::$_gid[$name]) { self::$_gid[$name] = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup', $name, 'id', 'name'); if (!self::$_gid[$name]) { @@ -292,7 +292,7 @@ class CRM_Core_BAO_LabelFormat extends CRM_Core_DAO_OptionValue { * @return array (reference) label format list * @static */ - public static function &getList($namesOnly = FALSE, $groupName='label_format') { + public static function &getList($namesOnly = FALSE, $groupName = 'label_format') { static $list = array(); if (self::_getGid($groupName)) { // get saved label formats from Option Value table @@ -431,7 +431,7 @@ class CRM_Core_BAO_LabelFormat extends CRM_Core_DAO_OptionValue { * @return CRM_Core_DAO_OptionValue object * @static */ - public static function retrieve(&$params, &$values, $groupName='label_format') { + public static function retrieve(&$params, &$values, $groupName = 'label_format') { $optionValue = new CRM_Core_DAO_OptionValue(); $optionValue->copyValues($params); $optionValue->option_group_id = self::_getGid($groupName); diff --git a/CRM/Core/BAO/MessageTemplate.php b/CRM/Core/BAO/MessageTemplate.php index 4786e100a7..99466c6d0d 100644 --- a/CRM/Core/BAO/MessageTemplate.php +++ b/CRM/Core/BAO/MessageTemplate.php @@ -224,7 +224,7 @@ class CRM_Core_BAO_MessageTemplate extends CRM_Core_DAO_MessageTemplate { $$bodyType = CRM_Utils_Token::replaceDomainTokens($$bodyType, $domain, TRUE, $tokens, TRUE); $$bodyType = CRM_Utils_Token::replaceContactTokens($$bodyType, $contact, FALSE, $tokens, FALSE, TRUE); $$bodyType = CRM_Utils_Token::replaceComponentTokens($$bodyType, $contact, $tokens, TRUE); - $$bodyType = CRM_Utils_Token::replaceHookTokens($$bodyType, $contact , $categories, TRUE); + $$bodyType = CRM_Utils_Token::replaceHookTokens($$bodyType, $contact, $categories, TRUE); } } $html = $body_html; diff --git a/CRM/Core/BAO/OptionValue.php b/CRM/Core/BAO/OptionValue.php index 336ff380fc..21fd31a6b5 100644 --- a/CRM/Core/BAO/OptionValue.php +++ b/CRM/Core/BAO/OptionValue.php @@ -58,7 +58,7 @@ class CRM_Core_BAO_OptionValue extends CRM_Core_DAO_OptionValue { if (!empty($params['id'])) { $ids = array('optionValue' => $params['id']); } - return CRM_Core_BAO_OptionValue::add($params, $ids); + return CRM_Core_BAO_OptionValue::add($params, $ids); } /** * Set default Parameters diff --git a/CRM/Core/BAO/PdfFormat.php b/CRM/Core/BAO/PdfFormat.php index 06e039bb43..40e3ca82bc 100644 --- a/CRM/Core/BAO/PdfFormat.php +++ b/CRM/Core/BAO/PdfFormat.php @@ -55,7 +55,7 @@ class CRM_Core_BAO_PdfFormat extends CRM_Core_DAO_OptionValue { ), 'stationery' => array( 'name' => 'stationery', - 'type' =>CRM_Utils_Type::T_STRING, + 'type' => CRM_Utils_Type::T_STRING, 'default' => '', ), 'orientation' => array( diff --git a/CRM/Core/BAO/SchemaHandler.php b/CRM/Core/BAO/SchemaHandler.php index c7adca4c00..4fa3c4dc1d 100644 --- a/CRM/Core/BAO/SchemaHandler.php +++ b/CRM/Core/BAO/SchemaHandler.php @@ -363,7 +363,7 @@ ALTER TABLE {$tableName} /** * Delete a civiCRM-table * - * @param String $tableName + * @param string $tableName * Name of the table to be created. * * @return bool diff --git a/CRM/Core/BAO/Setting.php b/CRM/Core/BAO/Setting.php index 8c2a3b7f31..7ab3f5778f 100644 --- a/CRM/Core/BAO/Setting.php +++ b/CRM/Core/BAO/Setting.php @@ -555,7 +555,7 @@ class CRM_Core_BAO_Setting extends CRM_Core_DAO_Setting { ); $settingParams = array_diff_key($params, array_fill_keys($ignoredParams, TRUE)); $getFieldsParams = array('version' => 3); - if (count($settingParams) ==1) { + if (count($settingParams) == 1) { // ie we are only setting one field - we'll pass it into getfields for efficiency list($name) = array_keys($settingParams); $getFieldsParams['name'] = $name; @@ -788,7 +788,7 @@ class CRM_Core_BAO_Setting extends CRM_Core_DAO_Setting { // whenever there is a possibility of more than one domain we must force it $config = CRM_Core_Config::singleton(); if (empty($domainID)) { - $domainID= CRM_Core_Config::domainID(); + $domainID = CRM_Core_Config::domainID(); } $domain = new CRM_Core_DAO_Domain(); $domain->id = $domainID; diff --git a/CRM/Core/I18n/SchemaStructure_4_2_alpha1.php b/CRM/Core/I18n/SchemaStructure_4_2_alpha1.php index 216e8d13df..f14be3e03b 100644 --- a/CRM/Core/I18n/SchemaStructure_4_2_alpha1.php +++ b/CRM/Core/I18n/SchemaStructure_4_2_alpha1.php @@ -31,13 +31,11 @@ * $Id$ * */ -class CRM_Core_I18n_SchemaStructure_4_2_alpha1 -{ +class CRM_Core_I18n_SchemaStructure_4_2_alpha1 { /** * @return array */ - public static function &columns() - { + public static function &columns() { static $result = NULL; if (!$result) { $result = array( diff --git a/CRM/Core/I18n/SchemaStructure_4_3_1.php b/CRM/Core/I18n/SchemaStructure_4_3_1.php index 537196f575..f5838ef226 100644 --- a/CRM/Core/I18n/SchemaStructure_4_3_1.php +++ b/CRM/Core/I18n/SchemaStructure_4_3_1.php @@ -31,8 +31,7 @@ * $Id$ * */ -class CRM_Core_I18n_SchemaStructure_4_3_1 -{ +class CRM_Core_I18n_SchemaStructure_4_3_1 { /** * @return array */ diff --git a/CRM/Core/I18n/SchemaStructure_4_5_beta2.php b/CRM/Core/I18n/SchemaStructure_4_5_beta2.php index 4c5b2b4650..df8b61c2ec 100644 --- a/CRM/Core/I18n/SchemaStructure_4_5_beta2.php +++ b/CRM/Core/I18n/SchemaStructure_4_5_beta2.php @@ -32,10 +32,8 @@ * Generated from schema_structure.tpl * DO NOT EDIT. Generated by CRM_Core_CodeGen */ -class CRM_Core_I18n_SchemaStructure_4_5_beta2 -{ - public static function &columns() - { +class CRM_Core_I18n_SchemaStructure_4_5_beta2 { + public static function &columns() { static $result = NULL; if (!$result) { $result = array( diff --git a/CRM/Core/IDS.php b/CRM/Core/IDS.php index 75713269ee..cbfea6765a 100644 --- a/CRM/Core/IDS.php +++ b/CRM/Core/IDS.php @@ -181,7 +181,7 @@ class CRM_Core_IDS { * * @return boolean */ - private function react(IDS_Report$result) { + private function react(IDS_Report $result) { $impact = $result->getImpact(); if ($impact >= $this->threshold['kick']) { diff --git a/CRM/Core/Invoke.php b/CRM/Core/Invoke.php index 73a35cc9a4..add454bd06 100644 --- a/CRM/Core/Invoke.php +++ b/CRM/Core/Invoke.php @@ -107,7 +107,7 @@ class CRM_Core_Invoke { * @void */ static public function hackMenuRebuild($args) { - if (array('civicrm','menu','rebuild') == $args || array('civicrm', 'clearcache') == $args) { + if (array('civicrm', 'menu', 'rebuild') == $args || array('civicrm', 'clearcache') == $args) { // ensure that the user has a good privilege level if (CRM_Core_Permission::check('administer CiviCRM')) { self::rebuildMenuAndCaches(); @@ -268,7 +268,7 @@ class CRM_Core_Invoke { $result = NULL; if (is_array($item['page_callback'])) { - require_once (str_replace('_', DIRECTORY_SEPARATOR, $item['page_callback'][0]) . '.php'); + require_once str_replace('_', DIRECTORY_SEPARATOR, $item['page_callback'][0]) . '.php'; $result = call_user_func($item['page_callback']); } elseif (strstr($item['page_callback'], '_Form')) { @@ -281,7 +281,7 @@ class CRM_Core_Invoke { } else { $newArgs = explode('/', $_GET[$config->userFrameworkURLVar]); - require_once (str_replace('_', DIRECTORY_SEPARATOR, $item['page_callback']) . '.php'); + require_once str_replace('_', DIRECTORY_SEPARATOR, $item['page_callback']) . '.php'; $mode = 'null'; if (isset($pageArgs['mode'])) { $mode = $pageArgs['mode']; diff --git a/CRM/Core/Payment/PayPalProIPN.php b/CRM/Core/Payment/PayPalProIPN.php index 673bbc60f6..c1bc92e035 100644 --- a/CRM/Core/Payment/PayPalProIPN.php +++ b/CRM/Core/Payment/PayPalProIPN.php @@ -531,7 +531,7 @@ INNER JOIN civicrm_membership_payment mp ON m.id = mp.membership_id AND mp.contr } $input['invoice'] = self::getValue('i', FALSE); $this->getInput($input, $ids); - if ($this-> transactionExists($input['trxn_id'])) { + if ($this->transactionExists($input['trxn_id'])) { throw new CRM_Core_Exception('This transaction has already been processed'); } diff --git a/CRM/Core/Permission/Drupal.php b/CRM/Core/Permission/Drupal.php index 9cc51f98dc..dbac73bc57 100644 --- a/CRM/Core/Permission/Drupal.php +++ b/CRM/Core/Permission/Drupal.php @@ -36,7 +36,7 @@ /** * */ -class CRM_Core_Permission_Drupal extends CRM_Core_Permission_DrupalBase{ +class CRM_Core_Permission_Drupal extends CRM_Core_Permission_DrupalBase { /** * Is this user someone with access for the entire system diff --git a/CRM/Core/Permission/Drupal8.php b/CRM/Core/Permission/Drupal8.php index 380c0ea4fa..a4bba0d6af 100644 --- a/CRM/Core/Permission/Drupal8.php +++ b/CRM/Core/Permission/Drupal8.php @@ -36,7 +36,7 @@ /** * */ -class CRM_Core_Permission_Drupal8 extends CRM_Core_Permission_DrupalBase{ +class CRM_Core_Permission_Drupal8 extends CRM_Core_Permission_DrupalBase { /** * Given a permission string, check for access requirements * diff --git a/CRM/Core/Resources.php b/CRM/Core/Resources.php index b431eb30b5..8430d009dd 100644 --- a/CRM/Core/Resources.php +++ b/CRM/Core/Resources.php @@ -333,7 +333,7 @@ class CRM_Core_Resources { * Variable substitutions can happen from client-side * * Note: this function rarely needs to be called directly and is mostly for internal use. - * @see CRM_Core_Resources::addScriptFile which automatically adds translated strings from js files + * See CRM_Core_Resources::addScriptFile which automatically adds translated strings from js files * * Simple example: * // From php: diff --git a/CRM/Custom/Import/Field.php b/CRM/Custom/Import/Field.php index 79d41a1b5b..e4079d38cc 100644 --- a/CRM/Custom/Import/Field.php +++ b/CRM/Custom/Import/Field.php @@ -28,4 +28,5 @@ /** * Class CRM_Custom_Import_Field */ -class CRM_Custom_Import_Field extends CRM_Contact_Import_Field{} +class CRM_Custom_Import_Field extends CRM_Contact_Import_Field { +} diff --git a/CRM/Event/Form/Participant.php b/CRM/Event/Form/Participant.php index c2506d53b2..b6c0c0b4c1 100644 --- a/CRM/Event/Form/Participant.php +++ b/CRM/Event/Form/Participant.php @@ -882,7 +882,7 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment CRM_Event_BAO_Participant::deleteParticipant($this->_id); CRM_Core_Session::setStatus(ts('Selected participant was deleted successfully.'), ts('Record Deleted'), 'success'); if (!empty($participantLinks)) { - $status = ts('The following participants no longer have an event fee recorded. You can edit their registration and record a replacement contribution by clicking the links below:') . '
' . $participantLinks; + $status = ts('The following participants no longer have an event fee recorded. You can edit their registration and record a replacement contribution by clicking the links below:') . '
' . $participantLinks; CRM_Core_Session::setStatus($status, ts('Group Payment Deleted')); } return; diff --git a/CRM/Event/Form/Registration/Confirm.php b/CRM/Event/Form/Registration/Confirm.php index d02c88692f..37997cc45c 100644 --- a/CRM/Event/Form/Registration/Confirm.php +++ b/CRM/Event/Form/Registration/Confirm.php @@ -409,7 +409,7 @@ class CRM_Event_Form_Registration_Confirm extends CRM_Event_Form_Registration { } if (!empty($errors)) { - $soldOutOptions = implode("
", $priceSetErrors['soldOutOptions']); + $soldOutOptions = implode("
", $priceSetErrors['soldOutOptions']); CRM_Core_Session::setStatus(ts('You have been returned to the start of the registration process and any sold out events have been removed from your selections. You will not be able to continue until you review your booking and select different events if you wish. The following events were sold out:'), ts('Unfortunately some of your options have now sold out for one or more participants.'), 'error'); CRM_Core_Session::setStatus(ts("{$soldOutOptions}"), ts('Sold out:'), 'error'); CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/event/register', "_qf_Register_display=true&qfKey=" . $fields['qfKey'])); diff --git a/CRM/Event/Form/Registration/Register.php b/CRM/Event/Form/Registration/Register.php index 66681f4721..32b5c0be30 100644 --- a/CRM/Event/Form/Registration/Register.php +++ b/CRM/Event/Form/Registration/Register.php @@ -349,8 +349,16 @@ class CRM_Event_Form_Registration_Register extends CRM_Event_Form_Registration { // Hardcode maximum number of additional participants here for now. May need to make this configurable per event. // Label is value + 1, since the code sees this is ADDITIONAL participants (in addition to "self") $additionalOptions = array( - '' => '1', 1 => '2', 2 => '3', 3 => '4', 4 => '5', - 5 => '6', 6 => '7', 7 => '8', 8 => '9', 9 => '10', + '' => '1', + 1 => '2', + 2 => '3', + 3 => '4', + 4 => '5', + 5 => '6', + 6 => '7', + 7 => '8', + 8 => '9', + 9 => '10', ); $element = $this->add('select', 'additional_participants', ts('How many people are you registering?'), diff --git a/CRM/Event/Form/Task/Delete.php b/CRM/Event/Form/Task/Delete.php index 12f19c12c1..e52e6c5daf 100644 --- a/CRM/Event/Form/Task/Delete.php +++ b/CRM/Event/Form/Task/Delete.php @@ -125,7 +125,7 @@ class CRM_Event_Form_Task_Delete extends CRM_Event_Form_Task { $status = array(ts('Participant(s) Deleted: %1 (Total Selected: %2)', array(1 => $deletedParticipants, 2 => count($this->_participantIds)))); if (!empty($participantLinks)) { - $status[] = ts('The following participants no longer have an event fee recorded. You can edit their registration and record a replacement contribution by clicking the links below:') . '
' . $participantLinks; + $status[] = ts('The following participants no longer have an event fee recorded. You can edit their registration and record a replacement contribution by clicking the links below:') . '
' . $participantLinks; } foreach ($status as $text) { CRM_Core_Session::setStatus($text, '', 'info'); diff --git a/CRM/Event/Page/EventInfo.php b/CRM/Event/Page/EventInfo.php index d6ff5b4705..37f9fd085e 100644 --- a/CRM/Event/Page/EventInfo.php +++ b/CRM/Event/Page/EventInfo.php @@ -102,7 +102,7 @@ class CRM_Event_Page_EventInfo extends CRM_Core_Page { ); //CRM-10434 - $discountId= CRM_Core_BAO_Discount::findSet($this->_id, 'civicrm_event'); + $discountId = CRM_Core_BAO_Discount::findSet($this->_id, 'civicrm_event'); if ($discountId) { $priceSetId = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_Discount', $discountId, 'price_set_id'); } diff --git a/CRM/Export/BAO/Export.php b/CRM/Export/BAO/Export.php index 77e75cafa7..0ad4266f68 100644 --- a/CRM/Export/BAO/Export.php +++ b/CRM/Export/BAO/Export.php @@ -1250,7 +1250,7 @@ INSERT INTO {$componentTable} SELECT distinct gc.contact_id FROM civicrm_group_c if ($parserClass[0] == 'CRM' && count($parserClass) >= 3 ) { - require_once(str_replace('_', DIRECTORY_SEPARATOR, $parserName) . ".php"); + require_once str_replace('_', DIRECTORY_SEPARATOR, $parserName) . ".php"; // ensure the functions exists if (method_exists($parserName, 'errorFileName') && method_exists($parserName, 'saveFileName') @@ -1279,10 +1279,10 @@ INSERT INTO {$componentTable} SELECT distinct gc.contact_id FROM civicrm_group_c public static function exportCustom($customSearchClass, $formValues, $order) { $ext = CRM_Extension_System::singleton()->getMapper(); if (!$ext->isExtensionClass($customSearchClass)) { - require_once(str_replace('_', DIRECTORY_SEPARATOR, $customSearchClass) . '.php'); + require_once str_replace('_', DIRECTORY_SEPARATOR, $customSearchClass) . '.php'; } else { - require_once($ext->classToPath($customSearchClass)); + require_once $ext->classToPath($customSearchClass); } $search = new $customSearchClass($formValues); diff --git a/CRM/Financial/BAO/PaymentProcessor.php b/CRM/Financial/BAO/PaymentProcessor.php index 7908545f28..adb740cb33 100644 --- a/CRM/Financial/BAO/PaymentProcessor.php +++ b/CRM/Financial/BAO/PaymentProcessor.php @@ -36,8 +36,7 @@ /** * This class contains payment processor related functions. */ -class CRM_Financial_BAO_PaymentProcessor extends CRM_Financial_DAO_PaymentProcessor -{ +class CRM_Financial_BAO_PaymentProcessor extends CRM_Financial_DAO_PaymentProcessor { /** * Static holder for the default payment processor */ diff --git a/CRM/Financial/BAO/PaymentProcessorType.php b/CRM/Financial/BAO/PaymentProcessorType.php index 1335d0be69..0108f5e5c9 100644 --- a/CRM/Financial/BAO/PaymentProcessorType.php +++ b/CRM/Financial/BAO/PaymentProcessorType.php @@ -196,7 +196,7 @@ WHERE pp.payment_processor_type_id = ppt.id AND ppt.id = %1"; $paymentProcessorType = new CRM_Financial_DAO_PaymentProcessorType(); $paymentProcessorType->id = $paymentProcessorTypeId; if ($paymentProcessorType->delete()) { - CRM_Core_Session::setStatus(ts('Selected Payment Processor type has been deleted.
'), '', 'success'); + CRM_Core_Session::setStatus(ts('Selected Payment Processor type has been deleted.
'), '', 'success'); return TRUE; } } diff --git a/CRM/Member/Page/Tab.php b/CRM/Member/Page/Tab.php index 506944d823..ec75c1dccd 100644 --- a/CRM/Member/Page/Tab.php +++ b/CRM/Member/Page/Tab.php @@ -348,8 +348,7 @@ class CRM_Member_Page_Tab extends CRM_Core_Page { if ($this->_action & CRM_Core_Action::VIEW) { $this->view(); } - elseif ($this->_action & (CRM_Core_Action::UPDATE | CRM_Core_Action::ADD | CRM_Core_Action::DELETE - | CRM_Core_Action::RENEW)) { + elseif ($this->_action & (CRM_Core_Action::UPDATE | CRM_Core_Action::ADD | CRM_Core_Action::DELETE | CRM_Core_Action::RENEW)) { self::setContext($this); $this->edit(); } diff --git a/CRM/Report/Form.php b/CRM/Report/Form.php index 8b9ba4dd28..374f1cbc50 100644 --- a/CRM/Report/Form.php +++ b/CRM/Report/Form.php @@ -842,7 +842,7 @@ class CRM_Report_Form extends CRM_Core_Form { /** * Setter for $_limitValue * - * @param number $_limitValue + * @param int $_limitValue */ public function setLimitValue($_limitValue) { $this->_limitValue = $_limitValue; @@ -851,7 +851,7 @@ class CRM_Report_Form extends CRM_Core_Form { /** * Setter for $_offsetValue * - * @param number $_offsetValue + * @param int $_offsetValue */ public function setOffsetValue($_offsetValue) { $this->_offsetValue = $_offsetValue; @@ -2752,9 +2752,7 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND if (in_array($op, array('bw', 'nbw')) && ($min || $max)) { $value = "{$pair[$op]} $min " . ts('and') . " $max"; } - elseif ($val && CRM_Utils_Array::value('operatorType', $field) & - self::OP_ENTITYREF - ) { + elseif ($val && CRM_Utils_Array::value('operatorType', $field) & self::OP_ENTITYREF) { $this->setEntityRefDefaults($field, $tableName); $result = civicrm_api3($field['attributes']['entity'], 'getlist', array('id' => $val) + diff --git a/CRM/Report/Form/Contribute/Repeat.php b/CRM/Report/Form/Contribute/Repeat.php index 9ad338b290..c41c9fc4bd 100644 --- a/CRM/Report/Form/Contribute/Repeat.php +++ b/CRM/Report/Form/Contribute/Repeat.php @@ -509,7 +509,7 @@ LEFT JOIN civicrm_temp_civireport_repeat2 {$this->_aliases['civicrm_contribution } } if (!empty($tempErrors)) { - $errors['fields'] = implode("
", $tempErrors); + $errors['fields'] = implode("
", $tempErrors); } } diff --git a/CRM/SMS/Page/Callback.php b/CRM/SMS/Page/Callback.php index 734652ea5a..d8a3f16e9d 100644 --- a/CRM/SMS/Page/Callback.php +++ b/CRM/SMS/Page/Callback.php @@ -33,8 +33,7 @@ * */ -class CRM_SMS_Page_Callback -{ +class CRM_SMS_Page_Callback { public function run() { $provider = CRM_SMS_Provider::singleton($_REQUEST); diff --git a/CRM/Utils/Check.php b/CRM/Utils/Check.php index 84030a707a..0d91df745b 100644 --- a/CRM/Utils/Check.php +++ b/CRM/Utils/Check.php @@ -115,8 +115,7 @@ class CRM_Utils_Check { * plugin status page or the Drupal admin/reports/status path. * * @return array of messages - * @see Drupal's hook_requirements() - - * https://api.drupal.org/api/drupal/modules%21system%21system.api.php/function/hook_requirements + * @link https://api.drupal.org/api/drupal/modules%21system%21system.api.php/function/hook_requirements */ public function checkAll() { $checks = array(); diff --git a/CRM/Utils/REST.php b/CRM/Utils/REST.php index 15ac43d4b4..f4e01c39dd 100644 --- a/CRM/Utils/REST.php +++ b/CRM/Utils/REST.php @@ -476,7 +476,7 @@ class CRM_Utils_REST { die ("SECURITY FATAL: the url can't contain '..'. Please report the issue on the forum at civicrm.org"); } - $request = split('/', $request); + $request = explode('/', $request); $entity = _civicrm_api_get_camel_name($request[2]); $tplfile = _civicrm_api_get_camel_name($request[3]); diff --git a/CRM/Utils/Zip.php b/CRM/Utils/Zip.php index 2499aec9fb..c445ce6903 100644 --- a/CRM/Utils/Zip.php +++ b/CRM/Utils/Zip.php @@ -61,7 +61,8 @@ class CRM_Utils_Zip { else { return FALSE; } - } elseif (0 != substr_compare($base, $filename, 0, $baselen)) { + } + elseif (0 != substr_compare($base, $filename, 0, $baselen)) { return FALSE; } }