From: monishdeb Date: Tue, 3 Feb 2015 07:52:04 +0000 (+0530) Subject: INFRA-32 batch 11 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=bed983430218b8ec5be970ba52fa7300142565d3;hp=5552f12522cb2481ce8f8ccf028148084367237f;p=civicrm-core.git INFRA-32 batch 11 --- diff --git a/CRM/Activity/Form/Task/Email.php b/CRM/Activity/Form/Task/Email.php index 8be1cb2922..dc463c4293 100644 --- a/CRM/Activity/Form/Task/Email.php +++ b/CRM/Activity/Form/Task/Email.php @@ -61,7 +61,7 @@ class CRM_Activity_Form_Task_Email extends CRM_Activity_Form_Task { * * @return void */ - function preProcess() { + public function preProcess() { CRM_Contact_Form_Task_EmailCommon::preProcessFromAddress($this); parent::preProcess(); diff --git a/CRM/Admin/Page/Job.php b/CRM/Admin/Page/Job.php index 89d6993b56..e7fcf9987d 100644 --- a/CRM/Admin/Page/Job.php +++ b/CRM/Admin/Page/Job.php @@ -121,7 +121,7 @@ class CRM_Admin_Page_Job extends CRM_Core_Page_Basic { 'url' => CRM_Utils_System::url('civicrm/admin', 'reset=1' ), - ) + ), ); CRM_Utils_System::appendBreadCrumb($breadCrumb); diff --git a/CRM/Campaign/Form/Search/Petition.php b/CRM/Campaign/Form/Search/Petition.php index 98becd18f2..3d5dbf5d54 100755 --- a/CRM/Campaign/Form/Search/Petition.php +++ b/CRM/Campaign/Form/Search/Petition.php @@ -50,7 +50,7 @@ class CRM_Campaign_Form_Search_Petition extends CRM_Core_Form { * * @return void */ - function preProcess() { + public function preProcess() { $this->_search = CRM_Utils_Array::value('search', $_GET); $this->_force = CRM_Utils_Request::retrieve('force', 'Boolean', $this, FALSE, FALSE); $this->_searchTab = CRM_Utils_Request::retrieve('type', 'String', $this, FALSE, 'petition'); diff --git a/CRM/Contact/BAO/ContactType.php b/CRM/Contact/BAO/ContactType.php index 3be98214b7..9807af89a7 100644 --- a/CRM/Contact/BAO/ContactType.php +++ b/CRM/Contact/BAO/ContactType.php @@ -373,7 +373,7 @@ WHERE type.name IS NOT NULL * * @return mixed */ - static function getSelectElements( + public static function getSelectElements( $all = FALSE, $isSeparator = TRUE, $separator = '__' @@ -450,7 +450,7 @@ AND ( p.is_active = 1 OR p.id IS NULL ) * Contact subType. * @param bool $ignoreCache * - * @return boolean + * @return bool * true if subType, false otherwise. */ public static function isaSubType($subType, $ignoreCache = FALSE) { @@ -521,7 +521,7 @@ WHERE subtype.name IN ('" . implode("','", $subType) . "' )"; * @param bool $ignoreCache * @param string $columnName * - * @return boolean + * @return bool * true if contact extends, false otherwise. */ public static function isExtendsContactType($subType, $contactType, $ignoreCache = FALSE, $columnName = 'name') { @@ -628,18 +628,18 @@ WHERE name = %1"; * @param array $params * An assoc array of name/value pairs. * - * @return object + * @return object|void */ public static function add(&$params) { // label or name if (empty($params['id']) && empty($params['label'])) { - return; + return NULL; } if (!empty($params['parent_id']) && !CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_ContactType', $params['parent_id']) ) { - return; + return NULL; } $contactType = new CRM_Contact_DAO_ContactType(); @@ -734,7 +734,7 @@ WHERE name = %1"; * @param string $subType * Subtype. * - * @return boolean + * @return bool */ public static function isAllowEdit($contactId, $subType = NULL) { @@ -867,7 +867,7 @@ WHERE extends = %1 AND " . implode(" OR ", $subTypeClause); * * @return bool */ - static function deleteCustomSetForSubtypeMigration( + public static function deleteCustomSetForSubtypeMigration( $contactID, $contactType, $oldSubtypeSet = array(), diff --git a/CRM/Contact/BAO/GroupOrganization.php b/CRM/Contact/BAO/GroupOrganization.php index 9315b543c6..3eca1c2fe2 100644 --- a/CRM/Contact/BAO/GroupOrganization.php +++ b/CRM/Contact/BAO/GroupOrganization.php @@ -95,7 +95,7 @@ class CRM_Contact_BAO_GroupOrganization extends CRM_Contact_DAO_GroupOrganizatio * @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 @@ -123,7 +123,7 @@ class CRM_Contact_BAO_GroupOrganization extends CRM_Contact_DAO_GroupOrganizatio * * @param int $contactID * - * @return boolean + * @return bool */ public static function hasGroupAssociated($contactID) { $orgID = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_GroupOrganization', diff --git a/CRM/Contact/BAO/ProximityQuery.php b/CRM/Contact/BAO/ProximityQuery.php index 64a3e85e0a..5bf8209940 100644 --- a/CRM/Contact/BAO/ProximityQuery.php +++ b/CRM/Contact/BAO/ProximityQuery.php @@ -50,7 +50,7 @@ class CRM_Contact_BAO_ProximityQuery { * earth_eccentricity_sq = 2*$earth_flattening - pow($earth_flattening, 2); * This library is an implementation of UCB CS graduate student, Ka-Ping Yee (http://www.zesty.ca). * This version has been taken from Drupal's location module: http://drupal.org/project/location - **/ + */ static protected $_earthFlattening; static protected $_earthRadiusSemiMinor; @@ -206,8 +206,8 @@ class CRM_Contact_BAO_ProximityQuery { } /** - * @param float $longitude * @param float $latitude + * @param float $longitude * @param float $distance * @param string $tablePrefix * @@ -219,17 +219,8 @@ class CRM_Contact_BAO_ProximityQuery { $params = array(); $clause = array(); - list($minLongitude, $maxLongitude) = - self::earthLongitudeRange($longitude, - $latitude, - $distance - ); - list($minLatitude, $maxLatitude) = - self::earthLatitudeRange( - $longitude, - $latitude, - $distance - ); + list($minLongitude, $maxLongitude) = self::earthLongitudeRange($longitude, $latitude, $distance); + list($minLatitude, $maxLatitude) = self::earthLatitudeRange($longitude, $latitude, $distance); // DONT consider NAN values (which is returned by rad2deg php function) // for checking BETWEEN geo_code's criteria as it throws obvious 'NAN' field not found DB: Error @@ -266,6 +257,7 @@ ACOS( * @param array $values * * @throws Exception + * @return void */ public static function process(&$query, &$values) { list($name, $op, $distance, $grouping, $wildcard) = $values; @@ -297,7 +289,7 @@ ACOS( } if (empty($proximityAddress)) { - return; + return NULL; } if (isset($proximityAddress['state_province_id'])) { @@ -321,7 +313,6 @@ ACOS( $qill[] = $proximityAddress['country']; } - if ( isset($proximityAddress['distance_unit']) && $proximityAddress['distance_unit'] == 'miles' @@ -358,7 +349,7 @@ ACOS( $qill .= ': ' . ts('We could not geocode the destination address.'); $query->_qill[$grouping][] = $qill; $query->_where[$grouping][] = ' (0) '; - return; + return NULL; } $query->_qill[$grouping][] = $qill; @@ -368,11 +359,12 @@ ACOS( $distance ); - return; + return NULL; } /** * @param array $input + * retun void */ public static function fixInputParams(&$input) { foreach ($input as $param) { @@ -395,7 +387,7 @@ ACOS( } } } - return; + return NULL; } } } diff --git a/CRM/Contact/Form/GroupContact.php b/CRM/Contact/Form/GroupContact.php index d803a9335d..a03cb9e9aa 100644 --- a/CRM/Contact/Form/GroupContact.php +++ b/CRM/Contact/Form/GroupContact.php @@ -103,7 +103,7 @@ class CRM_Contact_Form_GroupContact extends CRM_Core_Form { $this->add('select', 'group_id', '', $groupSelect, TRUE, array( 'class' => 'crm-select2 crm-action-menu action-icon-plus', - 'placeholder' => $msg + 'placeholder' => $msg, )); $this->addButtons(array( diff --git a/CRM/Contact/Form/Relationship.php b/CRM/Contact/Form/Relationship.php index 37b02fc4fc..aea4c30362 100644 --- a/CRM/Contact/Form/Relationship.php +++ b/CRM/Contact/Form/Relationship.php @@ -352,7 +352,7 @@ class CRM_Contact_Form_Relationship extends CRM_Core_Form { $label = $this->_action & CRM_Core_Action::ADD ? ts('Contact(s)') : ts('Contact'); $contactField = $this->addEntityRef('related_contact_id', $label, array( 'multiple' => TRUE, - 'create' => TRUE + 'create' => TRUE, ), TRUE); // This field cannot be updated if ($this->_action & CRM_Core_Action::UPDATE) { @@ -471,25 +471,25 @@ class CRM_Contact_Form_Relationship extends CRM_Core_Form { if ($valid) { CRM_Core_Session::setStatus(ts('Relationship created.', array( 'count' => $valid, - 'plural' => '%count relationships created.' + 'plural' => '%count relationships created.', )), ts('Saved'), 'success'); } if ($invalid) { CRM_Core_Session::setStatus(ts('%count relationship record was not created due to an invalid contact type.', array( 'count' => $invalid, - 'plural' => '%count relationship records were not created due to invalid contact types.' + 'plural' => '%count relationship records were not created due to invalid contact types.', )), ts('%count invalid relationship record', array( 'count' => $invalid, - 'plural' => '%count invalid relationship records' + 'plural' => '%count invalid relationship records', ))); } if ($duplicate) { CRM_Core_Session::setStatus(ts('One relationship was not created because it already exists.', array( 'count' => $duplicate, - 'plural' => '%count relationships were not created because they already exist.' + 'plural' => '%count relationships were not created because they already exist.', )), ts('%count duplicate relationship', array( 'count' => $duplicate, - 'plural' => '%count duplicate relationships' + 'plural' => '%count duplicate relationships', ))); } if ($saved) { diff --git a/CRM/Contact/Form/Task/SMSCommon.php b/CRM/Contact/Form/Task/SMSCommon.php index 226eb2503c..75d2c3484e 100644 --- a/CRM/Contact/Form/Task/SMSCommon.php +++ b/CRM/Contact/Form/Task/SMSCommon.php @@ -162,14 +162,14 @@ class CRM_Contact_Form_Task_SMSCommon { if ($extendTargetContacts) { $errorMess = ts('One selected activity consists of more than one target contact.', array( 'count' => $extendTargetContacts, - 'plural' => '%count selected activities consist of more than one target contact.' + 'plural' => '%count selected activities consist of more than one target contact.', )); } if ($invalidActivity) { $errorMess = ($errorMess ? ' ' : ''); $errorMess .= ts('The selected activity is invalid.', array( 'count' => $invalidActivity, - 'plural' => '%count selected activities are invalid.' + 'plural' => '%count selected activities are invalid.', )); } CRM_Core_Error::statusBounce(ts("%1: SMS Reply will not be sent.", array(1 => $errorMess))); @@ -270,7 +270,6 @@ class CRM_Contact_Form_Task_SMSCommon { $form->assign('extendTargetContacts', $extendTargetContacts); } - $form->assign('toContact', json_encode($toArray)); $form->assign('suppressedSms', $suppressedSms); $form->assign('totalSelectedContacts', count($form->_contactIds)); @@ -408,7 +407,7 @@ class CRM_Contact_Form_Task_SMSCommon { if ($countSuccess > 0) { CRM_Core_Session::setStatus(ts('One message was sent successfully.', array( 'plural' => '%count messages were sent successfully.', - 'count' => $countSuccess + 'count' => $countSuccess, )), ts('Message Sent', array('plural' => 'Messages Sent', 'count' => $countSuccess)), 'success'); } @@ -422,7 +421,7 @@ class CRM_Contact_Form_Task_SMSCommon { $status .= ''; CRM_Core_Session::setStatus($status, ts('One Message Not Sent', array( 'count' => count($sent), - 'plural' => '%count Messages Not Sent' + 'plural' => '%count Messages Not Sent', )), 'info'); } else { @@ -444,7 +443,7 @@ class CRM_Contact_Form_Task_SMSCommon { $status .= ')'; CRM_Core_Session::setStatus($status, ts('One Message Not Sent', array( 'count' => count($smsNotSent), - 'plural' => '%count Messages Not Sent' + 'plural' => '%count Messages Not Sent', )), 'info'); } } diff --git a/CRM/Contact/Import/Form/DataSource.php b/CRM/Contact/Import/Form/DataSource.php index 59a269beed..88390f9c23 100644 --- a/CRM/Contact/Import/Form/DataSource.php +++ b/CRM/Contact/Import/Form/DataSource.php @@ -56,7 +56,7 @@ class CRM_Contact_Import_Form_DataSource extends CRM_Core_Form { //Test database user privilege to create table(Temporary) CRM-4725 $errorScope = CRM_Core_TemporaryErrorScope::ignoreException(); - $daoTestPrivilege = new CRM_Core_DAO; + $daoTestPrivilege = new CRM_Core_DAO(); $daoTestPrivilege->query("CREATE TEMPORARY TABLE import_job_permission_one(test int) ENGINE=InnoDB"); $daoTestPrivilege->query("CREATE TEMPORARY TABLE import_job_permission_two(test int) ENGINE=InnoDB"); $daoTestPrivilege->query("DROP TABLE IF EXISTS import_job_permission_one, import_job_permission_two"); @@ -88,7 +88,7 @@ class CRM_Contact_Import_Form_DataSource extends CRM_Core_Form { if (!empty($results)) { CRM_Core_Error::fatal(ts('%1 file(s) in %2 directory are not writable. Listed file(s) might be used during the import to log the errors occurred during Import process. Contact your site administrator for assistance.', array( 1 => implode(', ', $results), - 2 => $config->uploadDir + 2 => $config->uploadDir, ))); } @@ -131,7 +131,6 @@ class CRM_Contact_Import_Form_DataSource extends CRM_Core_Form { * * @return void */ - public function buildQuickForm() { // If there's a dataSource in the query string, we need to load @@ -139,7 +138,7 @@ class CRM_Contact_Import_Form_DataSource extends CRM_Core_Form { if ($this->_dataSourceIsValid) { $this->_dataSourceClassFile = str_replace('_', '/', $this->_dataSource) . ".php"; require_once $this->_dataSourceClassFile; - $this->_dataSourceClass = new $this->_dataSource; + $this->_dataSourceClass = new $this->_dataSource(); $this->_dataSourceClass->buildQuickForm($this); } @@ -180,7 +179,6 @@ class CRM_Contact_Import_Form_DataSource extends CRM_Core_Form { $this->assign('savedMapping', $mappingArray); $this->addElement('select', 'savedMapping', ts('Mapping Option'), array('' => ts('- select -')) + $mappingArray); - $js = array('onClick' => "buildSubTypes();buildDedupeRules();"); // contact types option $contactOptions = array(); @@ -287,7 +285,7 @@ class CRM_Contact_Import_Form_DataSource extends CRM_Core_Form { ) { $dataSourceClass = "CRM_Import_DataSource_" . $matches[1]; require_once $dataSourceDir . DIRECTORY_SEPARATOR . $dataSourceFile; - $object = new $dataSourceClass; + $object = new $dataSourceClass(); $info = $object->getInfo(); $dataSources[$dataSourceClass] = $info['title']; } diff --git a/CRM/Contact/Page/View/Summary.php b/CRM/Contact/Page/View/Summary.php index 169a9766e9..03d2d270b2 100644 --- a/CRM/Contact/Page/View/Summary.php +++ b/CRM/Contact/Page/View/Summary.php @@ -360,14 +360,14 @@ class CRM_Contact_Page_View_Summary extends CRM_Contact_Page_View { foreach ($rest as $k => $v) { if ($accessCiviCRM && !empty($this->_viewOptions[$k])) { $allTabs[] = $v + array( - 'id' => $k, - 'url' => CRM_Utils_System::url( - "civicrm/contact/view/$k", - "reset=1&cid={$this->_contactId}" - ), - 'weight' => $weight, - 'count' => CRM_Contact_BAO_Contact::getCountComponent($k, $this->_contactId), - ); + 'id' => $k, + 'url' => CRM_Utils_System::url( + "civicrm/contact/view/$k", + "reset=1&cid={$this->_contactId}" + ), + 'weight' => $weight, + 'count' => CRM_Contact_BAO_Contact::getCountComponent($k, $this->_contactId), + ); $weight += 10; } } diff --git a/CRM/Contribute/BAO/Contribution.php b/CRM/Contribute/BAO/Contribution.php index bb56e5641c..2ca7dae940 100644 --- a/CRM/Contribute/BAO/Contribution.php +++ b/CRM/Contribute/BAO/Contribution.php @@ -87,11 +87,11 @@ class CRM_Contribute_BAO_Contribution extends CRM_Contribute_DAO_Contribution { * @param array $ids * The array that holds all the db ids. * - * @return CRM_Contribute_BAO_Contribution + * @return CRM_Contribute_BAO_Contribution|void */ public static function add(&$params, $ids = array()) { if (empty($params)) { - return; + return NULL; } //per http://wiki.civicrm.org/confluence/display/CRM/Database+layer we are moving away from $ids array $contributionID = CRM_Utils_Array::value('contribution', $ids, CRM_Utils_Array::value('id', $params)); @@ -643,7 +643,7 @@ class CRM_Contribute_BAO_Contribution extends CRM_Contribute_DAO_Contribution { 'name' => 'contribution_page', 'where' => 'civicrm_contribution_page.title', 'data_type' => CRM_Utils_Type::T_STRING, - ) + ), ); $contributionNote = array( @@ -2461,7 +2461,6 @@ WHERE contribution_id = %1 "; $values['financial_type_id'] = $this->financial_type_id; } - $template->assign('trxn_id', $this->trxn_id); $template->assign('receive_date', CRM_Utils_Date::mysqlToIso($this->receive_date) @@ -2775,7 +2774,6 @@ WHERE contribution_id = %1 "; $params['trxnParams']['trxn_id'] = $params['prevContribution']->trxn_id; $params['trxnParams']['status_id'] = $params['prevContribution']->contribution_status_id; - if (!(($params['prevContribution']->contribution_status_id == array_search('Pending', $contributionStatuses) || $params['prevContribution']->contribution_status_id == array_search('In Progress', $contributionStatuses)) && $params['contribution']->contribution_status_id == array_search('Completed', $contributionStatuses)) @@ -3151,10 +3149,8 @@ WHERE contribution_id = %1 "; * @see CRM_Core_DAO::buildOptions * * @param string $fieldName - * @param string $context - * @see CRM_Core_DAO::buildOptionsContext. - * @param array $props - * whatever is known about this dao object. + * @param string $context see CRM_Core_DAO::buildOptionsContext. + * @param array $props whatever is known about this dao object. * * @return array|bool */ diff --git a/CRM/Contribute/BAO/Widget.php b/CRM/Contribute/BAO/Widget.php index 731660dd9d..b08ed9d2d8 100644 --- a/CRM/Contribute/BAO/Widget.php +++ b/CRM/Contribute/BAO/Widget.php @@ -44,7 +44,7 @@ class CRM_Contribute_BAO_Widget extends CRM_Contribute_DAO_Widget { * @param int $contributionPageID * @param string $widgetID * - * @return stdClass + * @return object */ public static function getContributionPageData($contributionPageID, $widgetID) { $config = CRM_Core_Config::singleton(); @@ -125,10 +125,9 @@ class CRM_Contribute_BAO_Widget extends CRM_Contribute_DAO_Widget { ) { $data['is_active'] = FALSE; $data['campaign_start'] = ts('Campaign starts on %1', array( - 1 => CRM_Utils_Date::customFormat($dao->start_date, - $config->dateformatFull + 1 => CRM_Utils_Date::customFormat($dao->start_date, $config->dateformatFull), ) - )); + ); } } @@ -138,25 +137,25 @@ class CRM_Contribute_BAO_Widget extends CRM_Contribute_DAO_Widget { $endDate < $now ) { $data['is_active'] = FALSE; - $data['campaign_start'] = ts('Campaign ended on %1', array( - 1 => CRM_Utils_Date::customFormat($dao->end_date, - $config->dateformatFull + $data['campaign_start'] = ts('Campaign ended on %1', + array( + 1 => CRM_Utils_Date::customFormat($dao->end_date, $config->dateformatFull), ) - )); + ); } elseif ($startDate >= $now) { - $data['campaign_start'] = ts('Campaign starts on %1', array( - 1 => CRM_Utils_Date::customFormat($dao->start_date, - $config->dateformatFull + $data['campaign_start'] = ts('Campaign starts on %1', + array( + 1 => CRM_Utils_Date::customFormat($dao->start_date, $config->dateformatFull), ) - )); + ); } else { - $data['campaign_start'] = ts('Campaign ends on %1', array( - 1 => CRM_Utils_Date::customFormat($dao->end_date, - $config->dateformatFull + $data['campaign_start'] = ts('Campaign ends on %1', + array( + 1 => CRM_Utils_Date::customFormat($dao->end_date, $config->dateformatFull), ) - )); + ); } } } @@ -175,7 +174,7 @@ class CRM_Contribute_BAO_Widget extends CRM_Contribute_DAO_Widget { $data['money_target_display'] = CRM_Utils_Money::format($data['money_target']); $data['money_raised'] = ts('Raised %1 of %2', array( 1 => CRM_Utils_Money::format($data['money_raised']), - 2 => $data['money_target_display'] + 2 => $data['money_target_display'], )); } else { diff --git a/CRM/Core/Config/Defaults.php b/CRM/Core/Config/Defaults.php index 75ad06c4bc..81a74eb99f 100644 --- a/CRM/Core/Config/Defaults.php +++ b/CRM/Core/Config/Defaults.php @@ -78,7 +78,6 @@ class CRM_Core_Config_Defaults { * Format size * */ - public static function formatUnitSize($size, $checkForPostMax = FALSE) { if ($size) { $last = strtolower($size{strlen($size) - 1}); diff --git a/CRM/Core/JobManager.php b/CRM/Core/JobManager.php index 53c6c19a15..6a95b94c5f 100644 --- a/CRM/Core/JobManager.php +++ b/CRM/Core/JobManager.php @@ -54,7 +54,7 @@ class CRM_Core_JobManager { /** * Class constructor * - * @param void + * @return void */ public function __construct() { $config = CRM_Core_Config::singleton(); @@ -201,7 +201,7 @@ class CRM_Core_JobManager { /** * @param string $message * - * @return array|null + * @return void * collection of permissions, null if none */ public function logEntry($message) { diff --git a/CRM/Core/Payment/Google.php b/CRM/Core/Payment/Google.php index ae8cbf9fbe..b06247a737 100644 --- a/CRM/Core/Payment/Google.php +++ b/CRM/Core/Payment/Google.php @@ -108,7 +108,7 @@ class CRM_Core_Payment_Google extends CRM_Core_Payment { * @param array $params * Assoc array of input parameters for this transaction. * - * @return array + * @return void * the result in an nice formatted array (or an error object) * @abstract */ diff --git a/CRM/Event/BAO/Query.php b/CRM/Event/BAO/Query.php index 6a55fdfd6b..4a00fba788 100644 --- a/CRM/Event/BAO/Query.php +++ b/CRM/Event/BAO/Query.php @@ -380,7 +380,11 @@ class CRM_Event_BAO_Query { case 'event_type_id': $qillName = $name; - if (in_array($name, array('event_id', 'event_is_public'))) { + if (in_array($name, array( + 'event_id', + 'event_is_public', + ) + )) { $name = str_replace('event_', '', $name); } $dataType = !empty($fields[$qillName]['type']) ? CRM_Utils_Type::typeToString($fields[$qillName]['type']) : 'String'; @@ -467,7 +471,7 @@ class CRM_Event_BAO_Query { * * @return array|null */ - static function defaultReturnProperties( + public static function defaultReturnProperties( $mode, $includeCustomFields = TRUE ) { diff --git a/CRM/Event/Import/Form/DataSource.php b/CRM/Event/Import/Form/DataSource.php index dae3c5a63f..c04c77aa44 100644 --- a/CRM/Event/Import/Form/DataSource.php +++ b/CRM/Event/Import/Form/DataSource.php @@ -68,7 +68,7 @@ class CRM_Event_Import_Form_DataSource extends CRM_Core_Form { $this->setMaxFileSize($uploadFileSize); $this->addRule('uploadFile', ts('File size should be less than %1 MBytes (%2 bytes)', array( 1 => $uploadSize, - 2 => $uploadFileSize + 2 => $uploadFileSize, )), 'maxfilesize', $uploadFileSize); $this->addRule('uploadFile', ts('A valid file must be uploaded.'), 'uploadedfile'); $this->addRule('uploadFile', ts('Input file must be in CSV format'), 'utf8File'); diff --git a/CRM/Grant/StateMachine/Search.php b/CRM/Grant/StateMachine/Search.php index a3e55f5440..ed0abaa169 100644 --- a/CRM/Grant/StateMachine/Search.php +++ b/CRM/Grant/StateMachine/Search.php @@ -44,7 +44,7 @@ class CRM_Grant_StateMachine_Search extends CRM_Core_StateMachine { /** * Class constructor */ - function __construct($controller, $action = CRM_Core_Action::NONE) { + public function __construct($controller, $action = CRM_Core_Action::NONE) { parent::__construct($controller, $action); $this->_pages = array(); diff --git a/CRM/Import/DataSource/CSV.php b/CRM/Import/DataSource/CSV.php index ca0d8b4177..32c0e68968 100644 --- a/CRM/Import/DataSource/CSV.php +++ b/CRM/Import/DataSource/CSV.php @@ -74,7 +74,7 @@ class CRM_Import_DataSource_CSV extends CRM_Import_DataSource { $form->setMaxFileSize($uploadFileSize); $form->addRule('uploadFile', ts('File size should be less than %1 MBytes (%2 bytes)', array( 1 => $uploadSize, - 2 => $uploadFileSize + 2 => $uploadFileSize, )), 'maxfilesize', $uploadFileSize); $form->addRule('uploadFile', ts('Input file must be in CSV format'), 'utf8File'); $form->addRule('uploadFile', ts('A valid file must be uploaded.'), 'uploadedfile'); diff --git a/CRM/Import/Parser.php b/CRM/Import/Parser.php index d6841e37f8..c34b54a287 100644 --- a/CRM/Import/Parser.php +++ b/CRM/Import/Parser.php @@ -194,33 +194,33 @@ abstract class CRM_Import_Parser { /** * Abstract function definitions */ - abstract function init(); + abstract protected function init(); /** * @return mixed */ - abstract function fini(); + abstract protected function fini(); /** * @param $values * * @return mixed */ - abstract function mapField(&$values); + abstract protected function mapField(&$values); /** * @param $values * * @return mixed */ - abstract function preview(&$values); + abstract protected function preview(&$values); /** * @param $values * * @return mixed */ - abstract function summary(&$values); + abstract protected function summary(&$values); /** * @param $onDuplicate @@ -228,7 +228,7 @@ abstract class CRM_Import_Parser { * * @return mixed */ - abstract function import($onDuplicate, &$values); + abstract protected function import($onDuplicate, &$values); /** * Set and validate field values diff --git a/CRM/Logging/ReportDetail.php b/CRM/Logging/ReportDetail.php index 489eb3c1b5..3f0b4229e9 100644 --- a/CRM/Logging/ReportDetail.php +++ b/CRM/Logging/ReportDetail.php @@ -70,25 +70,24 @@ class CRM_Logging_ReportDetail extends CRM_Report_Form { parent::__construct(); CRM_Utils_System::resetBreadCrumb(); - $breadcrumb = + $breadcrumb = array( array( - array( - 'title' => ts('Home'), - 'url' => CRM_Utils_System::url() - ), - array( - 'title' => ts('CiviCRM'), - 'url' => CRM_Utils_System::url('civicrm', 'reset=1') - ), - array( - 'title' => ts('View Contact'), - 'url' => CRM_Utils_System::url('civicrm/contact/view', "reset=1&cid={$this->cid}") - ), - array( - 'title' => ts('Search Results'), - 'url' => CRM_Utils_System::url('civicrm/contact/search', "force=1") - ), - ); + 'title' => ts('Home'), + 'url' => CRM_Utils_System::url(), + ), + array( + 'title' => ts('CiviCRM'), + 'url' => CRM_Utils_System::url('civicrm', 'reset=1'), + ), + array( + 'title' => ts('View Contact'), + 'url' => CRM_Utils_System::url('civicrm/contact/view', "reset=1&cid={$this->cid}"), + ), + array( + 'title' => ts('Search Results'), + 'url' => CRM_Utils_System::url('civicrm/contact/search', "force=1"), + ), + ); CRM_Utils_System::appendBreadCrumb($breadcrumb); if (CRM_Utils_Request::retrieve('revert', 'Boolean', CRM_Core_DAO::$_nullObject)) { @@ -105,7 +104,7 @@ class CRM_Logging_ReportDetail extends CRM_Report_Form { // make sure the report works even without the params if (!$this->log_conn_id or !$this->log_date) { - $dao = new CRM_Core_DAO; + $dao = new CRM_Core_DAO(); $dao->query("SELECT log_conn_id, log_date FROM `{$this->db}`.log_{$this->tables[0]} WHERE log_action = 'Update' ORDER BY log_date DESC LIMIT 1"); $dao->fetch(); $this->log_conn_id = $dao->log_conn_id; diff --git a/CRM/Mailing/Event/BAO/Reply.php b/CRM/Mailing/Event/BAO/Reply.php index 24bff5a3d3..d7ca61e659 100644 --- a/CRM/Mailing/Event/BAO/Reply.php +++ b/CRM/Mailing/Event/BAO/Reply.php @@ -142,7 +142,7 @@ class CRM_Mailing_Event_BAO_Reply extends CRM_Mailing_Event_DAO_Reply { if ($fullEmail) { // parse the email and set a new destination - $parser = new ezcMailParser; + $parser = new ezcMailParser(); $set = new ezcMailVariableSet($fullEmail); $parsed = array_shift($parser->parseMail($set)); $parsed->to = array(new ezcMailAddress($mailing->replyto_email)); diff --git a/CRM/Price/Form/Option.php b/CRM/Price/Form/Option.php index f0dea450c5..bd649327f1 100644 --- a/CRM/Price/Form/Option.php +++ b/CRM/Price/Form/Option.php @@ -55,8 +55,6 @@ class CRM_Price_Form_Option extends CRM_Core_Form { /** * Set variables up before form is built * - * @param null - * * @return void */ public function preProcess() { @@ -73,14 +71,11 @@ class CRM_Price_Form_Option extends CRM_Core_Form { * 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 + * @return array|void array of default values */ public function setDefaultValues() { if ($this->_action == CRM_Core_Action::DELETE) { - return; + return NULL; } $defaults = array(); @@ -115,8 +110,6 @@ class CRM_Price_Form_Option extends CRM_Core_Form { /** * Build the form object * - * @param null - * * @return void */ public function buildQuickForm() { @@ -132,7 +125,7 @@ class CRM_Price_Form_Option extends CRM_Core_Form { ), ) ); - return; + return NULL; } else { $attributes = CRM_Core_DAO::getAttribute('CRM_Price_DAO_PriceFieldValue'); @@ -166,7 +159,7 @@ class CRM_Price_Form_Option extends CRM_Core_Form { $this->assign('showMember', TRUE); $membershipTypes = CRM_Member_PseudoConstant::membershipType(); $this->add('select', 'membership_type_id', ts('Membership Type'), array( - '' => ' ' + '' => ' ', ) + $membershipTypes, FALSE, array('onClick' => "calculateRowValues( );") ); @@ -294,8 +287,6 @@ class CRM_Price_Form_Option extends CRM_Core_Form { /** * Process the form * - * @param null - * * @return void */ public function postProcess() { @@ -310,7 +301,7 @@ class CRM_Price_Form_Option extends CRM_Core_Form { if (CRM_Price_BAO_PriceFieldValue::del($this->_oid)) { CRM_Core_Session::setStatus(ts('%1 option has been deleted.', array(1 => $label)), ts('Record Deleted'), 'success'); } - return; + return NULL; } else { $params = $ids = array(); diff --git a/CRM/Price/Form/Preview.php b/CRM/Price/Form/Preview.php index c69b635b89..01ad01b883 100644 --- a/CRM/Price/Form/Preview.php +++ b/CRM/Price/Form/Preview.php @@ -55,11 +55,9 @@ class CRM_Price_Form_Preview extends CRM_Core_Form { * * gets session variables for group or field id * - * @param null - * * @return void */ - function preProcess() { + public function preProcess() { // get the controller vars $groupId = $this->get('groupId'); $fieldId = $this->get('fieldId'); @@ -73,7 +71,7 @@ class CRM_Price_Form_Preview extends CRM_Core_Form { array( 'title' => ts('Price Set Fields'), 'url' => $url, - ) + ), ); } else { @@ -86,7 +84,7 @@ class CRM_Price_Form_Preview extends CRM_Core_Form { array( 'title' => ts('Price Sets'), 'url' => $url, - ) + ), ); } CRM_Utils_System::appendBreadCrumb($breadCrumb); @@ -95,8 +93,6 @@ class CRM_Price_Form_Preview extends CRM_Core_Form { /** * Set the default form values * - * @param null - * * @return array * the default array reference */ @@ -124,8 +120,6 @@ class CRM_Price_Form_Preview extends CRM_Core_Form { /** * Build the form object * - * @param null - * * @return void */ public function buildQuickForm() { diff --git a/CRM/Price/Form/Set.php b/CRM/Price/Form/Set.php index 8acde2685b..6bea08d0dc 100644 --- a/CRM/Price/Form/Set.php +++ b/CRM/Price/Form/Set.php @@ -48,8 +48,6 @@ class CRM_Price_Form_Set extends CRM_Core_Form { /** * Set variables up before form is built * - * @param null - * * @return void */ public function preProcess() { @@ -74,7 +72,7 @@ class CRM_Price_Form_Set extends CRM_Core_Form { array( 'title' => ts('Price Sets'), 'url' => $url, - ) + ), ); CRM_Utils_System::appendBreadCrumb($breadCrumb); } @@ -114,8 +112,6 @@ class CRM_Price_Form_Set extends CRM_Core_Form { /** * Build the form object * - * @param null - * * @return void */ public function buildQuickForm() { @@ -238,8 +234,6 @@ class CRM_Price_Form_Set extends CRM_Core_Form { * 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 */ @@ -261,8 +255,6 @@ class CRM_Price_Form_Set extends CRM_Core_Form { /** * Process the form * - * @param null - * * @return void */ public function postProcess() { @@ -302,7 +294,7 @@ class CRM_Price_Form_Set extends CRM_Core_Form { 'reset' => 1, 'action' => $action, 'sid' => $set->id, - 'new' => 1 + 'new' => 1, )); CRM_Core_Session::setStatus(ts("Your Set '%1' has been added. You can add fields to this set now.", array(1 => $set->title) diff --git a/CRM/Report/Form.php b/CRM/Report/Form.php index b519e19181..f6cc59d6b5 100644 --- a/CRM/Report/Form.php +++ b/CRM/Report/Form.php @@ -1332,6 +1332,7 @@ class CRM_Report_Form extends CRM_Core_Form { switch ($type) { case CRM_Report_Form::OP_INT: case CRM_Report_Form::OP_FLOAT: + return array( 'lte' => ts('Is less than or equal to'), 'gte' => ts('Is greater than or equal to'), @@ -1353,12 +1354,14 @@ class CRM_Report_Form extends CRM_Core_Form { case CRM_Report_Form::OP_MONTH: case CRM_Report_Form::OP_MULTISELECT: case CRM_Report_Form::OP_ENTITYREF: + return array( 'in' => ts('Is one of'), 'notin' => ts('Is not one of'), ); case CRM_Report_Form::OP_DATE: + return array( 'nll' => ts('Is empty (Null)'), 'nnll' => ts('Is not empty (Null)'), @@ -1842,7 +1845,7 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND */ public function formatCustomValues($value, $customField, $fieldValueMap) { if (CRM_Utils_System::isNull($value)) { - return; + return NULL; } $htmlType = $customField['html_type']; diff --git a/CRM/SMS/Page/Provider.php b/CRM/SMS/Page/Provider.php index c57e0abfc5..4414709c29 100644 --- a/CRM/SMS/Page/Provider.php +++ b/CRM/SMS/Page/Provider.php @@ -111,7 +111,7 @@ class CRM_SMS_Page_Provider extends CRM_Core_Page_Basic { 'url' => CRM_Utils_System::url('civicrm/admin/sms/provider', 'reset=1' ), - ) + ), ); CRM_Utils_System::appendBreadCrumb($breadCrumb); @@ -128,7 +128,7 @@ class CRM_SMS_Page_Provider extends CRM_Core_Page_Basic { /** * Browse all Providers. * - * @param null $action + * @param array $action * * @return void */ diff --git a/CRM/Upgrade/Incremental/php/FourFour.php b/CRM/Upgrade/Incremental/php/FourFour.php index 6d304608c7..6d7f437960 100644 --- a/CRM/Upgrade/Incremental/php/FourFour.php +++ b/CRM/Upgrade/Incremental/php/FourFour.php @@ -104,7 +104,7 @@ WHERE ceft.entity_table = 'civicrm_contribution' AND cft.payment_instrument_id I if ($dao->N) { $postUpgradeMessage .= '

' . ts('Your database contains %1 financial transaction records with no payment instrument (Paid By is empty). If you use the Accounting Batches feature this may result in unbalanced transactions. If you do not use this feature, you can ignore the condition (although you will be required to select a Paid By value for new transactions). You can review steps to correct transactions with missing payment instruments on the wiki.', array( 1 => $dao->N, - 2 => 'http://wiki.civicrm.org/confluence/display/CRMDOC/Fixing+Transactions+Missing+a+Payment+Instrument+-+4.4.3+Upgrades' + 2 => 'http://wiki.civicrm.org/confluence/display/CRMDOC/Fixing+Transactions+Missing+a+Payment+Instrument+-+4.4.3+Upgrades', )) . ''; } } @@ -357,11 +357,11 @@ ALTER TABLE civicrm_dashboard } /** - * @param CRM_Queue_TaskContext $ctx - * @param int $startId - * @param int $endId + * @param $rev + * @param $originalVer + * @param $latestVer * - * @return bool + * @return void */ public function upgrade_4_4_7($rev, $originalVer, $latestVer) { // For WordPress/Joomla(?), cleanup broken image_URL from 4.4.6 upgrades - https://issues.civicrm.org/jira/browse/CRM-14971 @@ -788,9 +788,9 @@ CREATE TABLE IF NOT EXISTS `civicrm_word_replacement` ( } - /*** + /** * CRM-13998 missing alter statements for civicrm_report_instance - ***/ + */ public function updateReportInstanceTable() { // add civicrm_report_instance.name diff --git a/CRM/Upgrade/Incremental/php/ThreeThree.php b/CRM/Upgrade/Incremental/php/ThreeThree.php index 3de241a344..dc98c089a2 100644 --- a/CRM/Upgrade/Incremental/php/ThreeThree.php +++ b/CRM/Upgrade/Incremental/php/ThreeThree.php @@ -362,13 +362,13 @@ INNER JOIN civicrm_option_group grp ON ( grp.id = val.option_group_id ) $config = CRM_Core_Config::singleton(); if (is_callable(array( $config->userSystem, - 'replacePermission' + 'replacePermission', ))) { $config->userSystem->replacePermission('access CiviMail', array( 'access CiviMail', 'create mailings', 'approve mailings', - 'schedule mailings' + 'schedule mailings', )); } } diff --git a/CRM/Upgrade/Incremental/php/ThreeTwo.php b/CRM/Upgrade/Incremental/php/ThreeTwo.php index 2b816aa2b3..bdabdb38f5 100644 --- a/CRM/Upgrade/Incremental/php/ThreeTwo.php +++ b/CRM/Upgrade/Incremental/php/ThreeTwo.php @@ -53,7 +53,7 @@ class CRM_Upgrade_Incremental_php_ThreeTwo { $config->userSystem->replacePermission('access CiviCase', array( 'access my cases and activities', 'access all cases and activities', - 'administer CiviCase' + 'administer CiviCase', )); //insert core acls. @@ -95,7 +95,7 @@ class CRM_Upgrade_Incremental_php_ThreeTwo { * @param $rev */ public function upgrade_3_2_beta4($rev) { - $upgrade = new CRM_Upgrade_Form; + $upgrade = new CRM_Upgrade_Form(); $config = CRM_Core_Config::singleton(); $seedLocale = $config->lcMessages; @@ -105,7 +105,7 @@ class CRM_Upgrade_Incremental_php_ThreeTwo { // CRM-6451: for multilingual sites we need to find the optimal // locale to use as the final civicrm_membership_status.name column - $domain = new CRM_Core_DAO_Domain; + $domain = new CRM_Core_DAO_Domain(); $domain->find(TRUE); $locales = array(); if ($domain->locales) { @@ -114,7 +114,7 @@ class CRM_Upgrade_Incremental_php_ThreeTwo { foreach (array( 'en_US', 'en_GB', - 'en_AU' + 'en_AU', ) as $loc) { if (in_array($loc, $locales)) { $seedLocale = $loc; @@ -223,7 +223,7 @@ class CRM_Upgrade_Incremental_php_ThreeTwo { $statusIds = array(); $insertedNewRecord = FALSE; foreach ($statuses as $status) { - $dao = new CRM_Member_DAO_MembershipStatus; + $dao = new CRM_Member_DAO_MembershipStatus(); // try to find an existing English status $dao->name = $status['name']; @@ -284,7 +284,7 @@ UPDATE civicrm_membership_status $config = CRM_Core_Config::singleton(); CRM_Utils_File::restrictAccess($config->uploadDir); CRM_Utils_File::restrictAccess($config->configAndLogDir); - $upgrade = new CRM_Upgrade_Form; + $upgrade = new CRM_Upgrade_Form(); $upgrade->assign('addActivityTypeIndex', $addActivityTypeIndex); $upgrade->processSQL($rev); } diff --git a/CRM/Utils/Geocode/Google.php b/CRM/Utils/Geocode/Google.php index 4bb160fc3c..d1b98eea75 100644 --- a/CRM/Utils/Geocode/Google.php +++ b/CRM/Utils/Geocode/Google.php @@ -60,7 +60,7 @@ class CRM_Utils_Geocode_Google { * @param array $values * @param bool $stateName * - * @return boolean + * @return bool * true if we modified the address, false otherwise */ public static function format(&$values, $stateName = FALSE) { diff --git a/Civi/CiUtil/Command/AntagonistCommand.php b/Civi/CiUtil/Command/AntagonistCommand.php index 5c970cba79..4f1bbfd44b 100644 --- a/Civi/CiUtil/Command/AntagonistCommand.php +++ b/Civi/CiUtil/Command/AntagonistCommand.php @@ -10,12 +10,12 @@ class AntagonistCommand { list ($program, $target, $suite) = $argv; $candidateTests = \Civi\CiUtil\PHPUnitScanner::findTestsByPath(array($suite)); -// $candidateTests = array( -// array('class' => 'CRM_Core_RegionTest', 'method' => 'testBlank'), -// array('class' => 'CRM_Core_RegionTest', 'method' => 'testDefault'), -// array('class' => 'CRM_Core_RegionTest', 'method' => 'testOverride'), -// array('class' => 'CRM_Core_RegionTest', 'method' => 'testAllTypes'), -// ); + // $candidateTests = array( + // array('class' => 'CRM_Core_RegionTest', 'method' => 'testBlank'), + // array('class' => 'CRM_Core_RegionTest', 'method' => 'testDefault'), + // array('class' => 'CRM_Core_RegionTest', 'method' => 'testOverride'), + // array('class' => 'CRM_Core_RegionTest', 'method' => 'testAllTypes'), + // ); $antagonist = self::findAntagonist($target, $candidateTests); if ($antagonist) { print_r(array('found an antagonist' => $antagonist)); diff --git a/Civi/CiUtil/PHPUnitScanner.php b/Civi/CiUtil/PHPUnitScanner.php index 61534bf535..85805da009 100644 --- a/Civi/CiUtil/PHPUnitScanner.php +++ b/Civi/CiUtil/PHPUnitScanner.php @@ -12,11 +12,10 @@ class PHPUnitScanner { * @return array class names */ public static function _findTestClasses($path) { -// print_r(array( -// 'loading' => $path, -// get_included_files() -// )); - + // print_r(array( + // 'loading' => $path, + // get_included_files() + // )); $origClasses = get_declared_classes(); require_once $path; $newClasses = get_declared_classes(); @@ -30,7 +29,6 @@ class PHPUnitScanner { /** * @param $paths * @return array (string $file => string $class) - * (string $file => string $class) * @throws \Exception */ public static function findTestClasses($paths) { @@ -88,7 +86,7 @@ class PHPUnitScanner { $r[] = array( 'file' => $testFile, 'class' => $testClass, - 'method' => $method->name + 'method' => $method->name, ); } } diff --git a/Civi/Core/Event/UnhandledExceptionEvent.php b/Civi/Core/Event/UnhandledExceptionEvent.php index f2f5b4528e..d45cd89c41 100644 --- a/Civi/Core/Event/UnhandledExceptionEvent.php +++ b/Civi/Core/Event/UnhandledExceptionEvent.php @@ -43,7 +43,7 @@ class UnhandledExceptionEvent extends \Symfony\Component\EventDispatcher\Event { */ public $request; - function __construct($e, $request) { + public function __construct($e, $request) { $this->request = $request; $this->exception = $e; } diff --git a/api/v3/Attachment.php b/api/v3/Attachment.php index 7640f1fc39..ccd87b143a 100644 --- a/api/v3/Attachment.php +++ b/api/v3/Attachment.php @@ -296,14 +296,14 @@ function __civicrm_api3_attachment_find($params, $id, $file, $entityFile, $isTru /** * @param array $params - * @return array - * (0 => int $id, 1 => array $file, 2 => array $entityFile, 3 => string $name, 4 => string $content, 5 => string $moveFile, 6 => $isTrusted, 7 => bool $returnContent) - * - array $file: whitelisted fields that can pass through directly to civicrm_file - * - array $entityFile: whitelisted fields that can pass through directly to civicrm_entity_file - * - string $name: the printable name - * - string $moveFile: the full path to a local file whose content should be loaded - * - bool $isTrusted: whether we trust the requester to do sketchy things (like moving files or reassigning entities) - * - bool $returnContent: whether we are expected to return the full content of the file + * @return array (0 => int $id, 1 => array $file, 2 => array $entityFile, 3 => string $name, 4 => string $content, + * 5 => string $moveFile, 6 => $isTrusted, 7 => bool $returnContent) + * - array $file: whitelisted fields that can pass through directly to civicrm_file + * - array $entityFile: whitelisted fields that can pass through directly to civicrm_entity_file + * - string $name: the printable name + * - string $moveFile: the full path to a local file whose content should be loaded + * - bool $isTrusted: whether we trust the requester to do sketchy things (like moving files or reassigning entities) + * - bool $returnContent: whether we are expected to return the full content of the file * @throws API_Exception validation errors */ function _civicrm_api3_attachment_parse_params($params) { diff --git a/api/v3/ContributionSoft.php b/api/v3/ContributionSoft.php index 5134e94f5b..a02bf614b8 100644 --- a/api/v3/ContributionSoft.php +++ b/api/v3/ContributionSoft.php @@ -46,9 +46,7 @@ * * @example ContributionSoftCreate.php Standard Create Example //FIXME * - * @return array - * API result array - * {@getfields contribution_soft_create} + * @return array API result array {@getfields contribution_soft_create} */ function civicrm_api3_contribution_soft_create($params) { return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params); @@ -73,9 +71,6 @@ function _civicrm_api3_contribution_soft_create_spec(&$params) { * @param array $params * * @example ContributionSoftDelete.php Standard Delete Example - * - * @return boolean - * | error true if successfull, error otherwise * {@getfields contribution_soft_delete} */ function civicrm_api3_contribution_soft_delete($params) { @@ -87,17 +82,11 @@ function civicrm_api3_contribution_soft_delete($params) { /** * Retrieve one or more Soft Credits * - * @param array input parameters - * - * * @example ContributionSoftGet.php Standard Get Example * - * @param array $params - * An associative array of name/value pairs. + * @param array $params An associative array of name/value pairs. * - * @return array - * api result - * {@getfields contribution_soft_get} + * @return array api result {@getfields contribution_soft_get} */ function civicrm_api3_contribution_soft_get($params) { return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params); diff --git a/api/v3/MailingEventUnsubscribe.php b/api/v3/MailingEventUnsubscribe.php index 79fe5b7b66..9145d0d838 100644 --- a/api/v3/MailingEventUnsubscribe.php +++ b/api/v3/MailingEventUnsubscribe.php @@ -43,9 +43,7 @@ * Associative array of property. * name/value pairs to insert in new 'survey' * - * @return array - * api result array - * {@getfields mailing_event_unsubscribe_create} + * @return array api result array {@getfields mailing_event_unsubscribe_create} */ function civicrm_api3_mailing_event_unsubscribe_create($params) { @@ -69,7 +67,6 @@ function civicrm_api3_mailing_event_unsubscribe_create($params) { return civicrm_api3_create_success($params); } - return civicrm_api3_create_error('Queue event could not be found'); } diff --git a/api/v3/Profile.php b/api/v3/Profile.php index c41b04b7ce..d93beafaea 100644 --- a/api/v3/Profile.php +++ b/api/v3/Profile.php @@ -115,7 +115,7 @@ function civicrm_api3_profile_get($params) { $ufGroupBAO->setComponentDefaults($activityFields, $params['activity_id'], 'Activity', $values[$profileID], TRUE); } } - elseif(!empty($params['contact_id'])) { + elseif (!empty($params['contact_id'])) { $ufGroupBAO->setProfileDefaults($params['contact_id'], $profileFields, $values[$profileID], TRUE); foreach ($values[$profileID] as $fieldName => $field) { // we should return 'Primary' with & without capitalisation. it is more consistent with api to not @@ -447,7 +447,7 @@ function _civicrm_api3_profile_getbillingpseudoprofile(&$params) { $values['billing_' . $fieldname . '-' . $locationTypeID] = isset($result['api.address.get.1']['values'][0][$fieldname]) ? $result['api.address.get.1']['values'][0][$fieldname] : ''; } } - elseif(!empty($result['api.address.get.2']['count'])) { + elseif (!empty($result['api.address.get.2']['count'])) { foreach ($addressFields as $fieldname) { $values['billing_' . $fieldname . '-' . $locationTypeID] = isset($result['api.address.get.2']['values'][0][$fieldname]) ? $result['api.address.get.2']['values'][0][$fieldname] : ''; } @@ -461,7 +461,7 @@ function _civicrm_api3_profile_getbillingpseudoprofile(&$params) { if (!empty($result['api.email.get.1']['count'])) { $values['billing-email' . '-' . $locationTypeID] = $result['api.email.get.1']['values'][0]['email']; } - elseif(!empty($result['api.email.get.2']['count'])) { + elseif (!empty($result['api.email.get.2']['count'])) { $values['billing-email' . '-' . $locationTypeID] = $result['api.email.get.2']['values'][0]['email']; } else { @@ -488,14 +488,14 @@ function _civicrm_api3_profile_getbillingpseudoprofile(&$params) { * 0 = don't resolve, 1 = resolve non-aggressively, 2 = resolve aggressively - ie include country & state. * @param $is_flush * - * @return array + * @return array|void */ function _civicrm_api3_buildprofile_submitfields($profileID, $optionsBehaviour = 1, $is_flush) { static $profileFields = array(); if ($is_flush) { $profileFields = array(); if (empty($profileID)) { - return; + return NULL; } } if (isset($profileFields[$profileID])) { @@ -644,7 +644,7 @@ function _civicrm_api3_map_profile_fields_to_entity(&$field) { } $fieldName .= '-' . $field['location_type_id']; } - elseif(array_key_exists($fieldName, $locationFields)) { + elseif (array_key_exists($fieldName, $locationFields)) { $fieldName .= '-Primary'; $entity = 'email'; } @@ -683,7 +683,7 @@ function _civicrm_api3_map_profile_fields_to_entity(&$field) { 'soft_credit_type' => 'contribution_soft', 'group' => 'group_contact', 'tag' => 'entity_tag', - ); + ); if (array_key_exists($fieldName, $hardCodedEntityMappings)) { $entity = $hardCodedEntityMappings[$fieldName]; } diff --git a/tests/phpunit/CRM/Case/BAO/CaseTest.php b/tests/phpunit/CRM/Case/BAO/CaseTest.php index addd089404..0bb6fceabb 100644 --- a/tests/phpunit/CRM/Case/BAO/CaseTest.php +++ b/tests/phpunit/CRM/Case/BAO/CaseTest.php @@ -57,14 +57,14 @@ class CRM_Case_BAO_CaseTest extends CiviUnitTestCase { $this->assertEquals(array(1), $caseIds); } - /* FIXME: need to create an activity to run this test + /** + * FIXME: need to create an activity to run this test * function testGetCases() { * $cases = CRM_Case_BAO_Case::getCases(TRUE, 3); * $this->assertEquals('Housing Support', $cases[1]['case_type']); * $this->assertEquals(1, $cases[1]['case_type_id']); * } */ - public function testGetCasesSummary() { $cases = CRM_Case_BAO_Case::getCasesSummary(TRUE, 3); $this->assertEquals(1, $cases['rows']['Housing Support']['Ongoing']['count']); diff --git a/tests/phpunit/WebTest/Import/AddressImportTest.php b/tests/phpunit/WebTest/Import/AddressImportTest.php index e1d760fef5..78448980da 100644 --- a/tests/phpunit/WebTest/Import/AddressImportTest.php +++ b/tests/phpunit/WebTest/Import/AddressImportTest.php @@ -89,17 +89,15 @@ class WebTest_Import_AddressImportTest extends ImportCiviSeleniumTestCase { } $rows = array( - 0 => - - array( - 'first_name' => $firstName1, - 'last_name' => 'Anderson', - 'address_1' => 'Add 1', - 'address_2' => 'Add 2', - 'city' => 'Watson', - 'state' => 'NY', - 'country' => 'United States', - ), + 0 => array( + 'first_name' => $firstName1, + 'last_name' => 'Anderson', + 'address_1' => 'Add 1', + 'address_2' => 'Add 2', + 'city' => 'Watson', + 'state' => 'NY', + 'country' => 'United States', + ), ); foreach ($customDataParams['rows'][0] as $key => $values) { $rows[0][$key] = $values; diff --git a/tests/phpunit/WebTest/Profile/MultiRecordProfileAddTest.php b/tests/phpunit/WebTest/Profile/MultiRecordProfileAddTest.php index 9865fed2cb..95201e6600 100644 --- a/tests/phpunit/WebTest/Profile/MultiRecordProfileAddTest.php +++ b/tests/phpunit/WebTest/Profile/MultiRecordProfileAddTest.php @@ -120,7 +120,7 @@ class WebTest_Profile_MultiRecordProfileAddTest extends CiviSeleniumTestCase { $this->openCiviPage('admin/uf/group/field/add', array( 'action' => 'add', 'reset' => 1, - 'gid' => $gid + 'gid' => $gid, ), 'field_name[0]'); //Add field to profile diff --git a/tests/phpunit/api/v3/CustomValueTest.php b/tests/phpunit/api/v3/CustomValueTest.php index 420def5838..ecc27bd643 100644 --- a/tests/phpunit/api/v3/CustomValueTest.php +++ b/tests/phpunit/api/v3/CustomValueTest.php @@ -63,8 +63,8 @@ class api_v3_CustomValueTest extends CiviUnitTestCase { public function testCreateCustomValue() { $params = array( - 'custom_' . $this->ids['single']['custom_field_id'] => 'customString' - ) + $this->params; + 'custom_' . $this->ids['single']['custom_field_id'] => 'customString', + ) + $this->params; $result = $this->callAPIAndDocument('custom_value', 'create', $params, __FUNCTION__, __FILE__); $this->assertEquals(1, $result['count'], 'In line ' . __LINE__); diff --git a/tests/phpunit/api/v3/UFFieldTest.php b/tests/phpunit/api/v3/UFFieldTest.php index 03a84e3265..84b95fac10 100644 --- a/tests/phpunit/api/v3/UFFieldTest.php +++ b/tests/phpunit/api/v3/UFFieldTest.php @@ -57,7 +57,7 @@ class api_v3_UFFieldTest extends CiviUnitTestCase { ) ); - $op = new PHPUnit_Extensions_Database_Operation_Insert; + $op = new PHPUnit_Extensions_Database_Operation_Insert(); $op->execute( $this->_dbconn, $this->createFlatXMLDataSet(dirname(__FILE__) . '/dataset/uf_group_test.xml')