From: yashodha Date: Thu, 15 Jan 2015 07:05:01 +0000 (+0530) Subject: clean up fixes for batch 5 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=87a890ccfea4520f9231d9b4ccd749aa222b2945;p=civicrm-core.git clean up fixes for batch 5 --- diff --git a/CRM/Admin/Form/Mapping.php b/CRM/Admin/Form/Mapping.php index ed1a99e5a9..0ff7d2ef5a 100644 --- a/CRM/Admin/Form/Mapping.php +++ b/CRM/Admin/Form/Mapping.php @@ -67,7 +67,7 @@ class CRM_Admin_Form_Mapping extends CRM_Admin_Form { ); $this->addRule('name', ts('Name already exists in Database.'), 'objectExists', array( 'CRM_Core_DAO_Mapping', - $this->_id + $this->_id, )); $this->addElement('text', 'description', ts('Description'), diff --git a/CRM/Campaign/Form/Task.php b/CRM/Campaign/Form/Task.php index 3fcab21335..f87ede84b4 100755 --- a/CRM/Campaign/Form/Task.php +++ b/CRM/Campaign/Form/Task.php @@ -81,7 +81,7 @@ class CRM_Campaign_Form_Task extends CRM_Core_Form { * * @return void */ - function preProcess() { + public function preProcess() { $values = $this->controller->exportValues('Search'); $this->_task = $values['task']; diff --git a/CRM/Contact/Form/Search/Custom/PriceSet.php b/CRM/Contact/Form/Search/Custom/PriceSet.php index ae6fd34e6e..2830daa662 100644 --- a/CRM/Contact/Form/Search/Custom/PriceSet.php +++ b/CRM/Contact/Form/Search/Custom/PriceSet.php @@ -276,7 +276,7 @@ AND p.entity_id = e.id * * @return string */ - function all( + public function all( $offset = 0, $rowcount = 0, $sort = NULL, $includeContactIDs = FALSE, $justIDs = FALSE ) { diff --git a/CRM/Contact/Import/Form/Preview.php b/CRM/Contact/Import/Form/Preview.php index cd916b6636..38b3f97b7c 100644 --- a/CRM/Contact/Import/Form/Preview.php +++ b/CRM/Contact/Import/Form/Preview.php @@ -149,7 +149,7 @@ class CRM_Contact_Import_Form_Preview extends CRM_Import_Form_Preview { if (!empty($groups)) { $this->addElement('select', 'groups', ts('Add imported records to existing group(s)'), $groups, array( 'multiple' => "multiple", - 'class' => 'crm-select2' + 'class' => 'crm-select2', )); } diff --git a/CRM/Contribute/Import/Form/Summary.php b/CRM/Contribute/Import/Form/Summary.php index 0dd9e0bbbe..3377c217d6 100644 --- a/CRM/Contribute/Import/Form/Summary.php +++ b/CRM/Contribute/Import/Form/Summary.php @@ -122,7 +122,7 @@ class CRM_Contribute_Import_Form_Summary extends CRM_Import_Form_Summary { 'validPledgePaymentRowCount', 'invalidPledgePaymentRowCount', 'downloadPledgePaymentErrorRecordsUrl', - 'downloadSoftCreditErrorRecordsUrl' + 'downloadSoftCreditErrorRecordsUrl', ); foreach ($properties as $property) { $this->assign($property, $this->get($property)); diff --git a/CRM/Core/I18n/SchemaStructure_2_2_0.php b/CRM/Core/I18n/SchemaStructure_2_2_0.php index 73ddecbb01..ea05322b81 100644 --- a/CRM/Core/I18n/SchemaStructure_2_2_0.php +++ b/CRM/Core/I18n/SchemaStructure_2_2_0.php @@ -47,7 +47,7 @@ class CRM_Core_I18n_SchemaStructure_2_2_0 { /** * @return mixed */ - static function &indices() { + public static function &indices() { static $result = NULL; if (!$result) { $result = unserialize('a:4:{s:20:"civicrm_custom_group";a:1:{s:16:"UI_title_extends";a:4:{s:4:"name";s:16:"UI_title_extends";s:5:"field";a:2:{i:0;s:5:"title";i:1;s:7:"extends";}s:11:"localizable";b:1;s:6:"unique";b:1;}}s:20:"civicrm_custom_field";a:1:{s:24:"UI_label_custom_group_id";a:4:{s:4:"name";s:24:"UI_label_custom_group_id";s:5:"field";a:2:{i:0;s:5:"label";i:1;s:15:"custom_group_id";}s:11:"localizable";b:1;s:6:"unique";b:1;}}s:17:"civicrm_price_set";a:1:{s:8:"UI_title";a:4:{s:4:"name";s:8:"UI_title";s:5:"field";a:1:{i:0;s:5:"title";}s:11:"localizable";b:1;s:6:"unique";b:1;}}s:15:"civicrm_contact";a:5:{s:15:"index_sort_name";a:3:{s:4:"name";s:15:"index_sort_name";s:5:"field";a:1:{i:0;s:9:"sort_name";}s:11:"localizable";b:1;}s:16:"index_first_name";a:3:{s:4:"name";s:16:"index_first_name";s:5:"field";a:1:{i:0;s:10:"first_name";}s:11:"localizable";b:1;}s:15:"index_last_name";a:3:{s:4:"name";s:15:"index_last_name";s:5:"field";a:1:{i:0;s:9:"last_name";}s:11:"localizable";b:1;}s:20:"index_household_name";a:3:{s:4:"name";s:20:"index_household_name";s:5:"field";a:1:{i:0;s:14:"household_name";}s:11:"localizable";b:1;}s:23:"index_organization_name";a:3:{s:4:"name";s:23:"index_organization_name";s:5:"field";a:1:{i:0;s:17:"organization_name";}s:11:"localizable";b:1;}}}'); diff --git a/CRM/Core/Permission/Soap.php b/CRM/Core/Permission/Soap.php index 1b35fe8e55..b28ed9c19f 100644 --- a/CRM/Core/Permission/Soap.php +++ b/CRM/Core/Permission/Soap.php @@ -44,10 +44,9 @@ class CRM_Core_Permission_Soap extends CRM_Core_Permission_Base { * @param string $str * The permission to check. * - * @return boolean + * @return bool * true if yes, else false */ - public function check($str) { return TRUE; } diff --git a/CRM/Core/Smarty/plugins/block.crmRegion.php b/CRM/Core/Smarty/plugins/block.crmRegion.php index 8ef43c0319..fb016e10b7 100644 --- a/CRM/Core/Smarty/plugins/block.crmRegion.php +++ b/CRM/Core/Smarty/plugins/block.crmRegion.php @@ -18,7 +18,7 @@ */ function smarty_block_crmRegion($params, $content, &$smarty, &$repeat) { if ($repeat) { - return; + return NULL; } require_once 'CRM/Core/Region.php'; $region = CRM_Core_Region::instance($params['name'], FALSE); diff --git a/CRM/Custom/Form/MoveField.php b/CRM/Custom/Form/MoveField.php index fcfb6913fd..0f9f22031f 100644 --- a/CRM/Custom/Form/MoveField.php +++ b/CRM/Custom/Form/MoveField.php @@ -116,8 +116,8 @@ class CRM_Custom_Form_MoveField extends CRM_Core_Form { } $customGroup = array( - '' => ts('- select -') - ) + $customGroup; + '' => ts('- select -'), + ) + $customGroup; $this->add('select', 'dst_group_id', ts('Destination'), diff --git a/CRM/Logging/Differ.php b/CRM/Logging/Differ.php index 58c3697cee..08db3bbb5c 100644 --- a/CRM/Logging/Differ.php +++ b/CRM/Logging/Differ.php @@ -81,7 +81,7 @@ class CRM_Logging_Differ { 2 => array($this->log_date, 'String'), ); - $logging = new CRM_Logging_Schema; + $logging = new CRM_Logging_Schema(); $addressCustomTables = $logging->entityCustomDataLogTables('Address'); $contactIdClause = $join = ''; @@ -311,7 +311,7 @@ WHERE lt.log_conn_id = %1 AND break; } - $dao = new $daos[$table]; + $dao = new $daos[$table](); foreach ($dao->fields() as $field) { $titles[$table][$field['name']] = CRM_Utils_Array::value('title', $field); diff --git a/CRM/Member/BAO/Query.php b/CRM/Member/BAO/Query.php index 1d14d1ca45..6b29e33ee1 100644 --- a/CRM/Member/BAO/Query.php +++ b/CRM/Member/BAO/Query.php @@ -392,7 +392,7 @@ class CRM_Member_BAO_Query { * * @return array|null */ - static function defaultReturnProperties( + public static function defaultReturnProperties( $mode, $includeCustomFields = TRUE ) { diff --git a/CRM/Member/Form/MembershipBlock.php b/CRM/Member/Form/MembershipBlock.php index 624411003d..f5b6cca94b 100644 --- a/CRM/Member/Form/MembershipBlock.php +++ b/CRM/Member/Form/MembershipBlock.php @@ -82,7 +82,7 @@ class CRM_Member_Form_MembershipBlock extends CRM_Contribute_Form_ContributionPa CRM_Core_DAO::commonRetrieveAll('CRM_Price_DAO_PriceField', 'price_set_id', $priceSetId, $pFIDs, $return = array( 'html_type', 'name', - 'label' + 'label', )); foreach ($pFIDs as $pid => $pValue) { if ($pValue['html_type'] == 'Radio' && $pValue['name'] == 'membership_amount') { diff --git a/CRM/Member/Form/Task/PickProfile.php b/CRM/Member/Form/Task/PickProfile.php index 91ae8b9529..5081749e17 100644 --- a/CRM/Member/Form/Task/PickProfile.php +++ b/CRM/Member/Form/Task/PickProfile.php @@ -73,7 +73,7 @@ class CRM_Member_Form_Task_PickProfile extends CRM_Member_Form_Task { if (count($this->_memberIds) > $this->_maxMembers) { CRM_Core_Session::setStatus(ts("The maximum number of members you can select for Batch Update is %1. You have selected %2. Please select fewer members from your search results and try again.", array( 1 => $this->_maxMembers, - 2 => count($this->_memberIds) + 2 => count($this->_memberIds), )), ts('Batch Update Error'), 'error'); $validate = TRUE; } @@ -101,7 +101,7 @@ class CRM_Member_Form_Task_PickProfile extends CRM_Member_Form_Task { $ufGroupElement = $this->add('select', 'uf_group_id', ts('Select Profile'), array( - '' => ts('- select profile -') + '' => ts('- select profile -'), ) + $profiles, TRUE ); $this->addDefaultButtons(ts('Continue')); diff --git a/CRM/Member/StateMachine/Search.php b/CRM/Member/StateMachine/Search.php index c3f8ce5e0e..eef573eccb 100644 --- a/CRM/Member/StateMachine/Search.php +++ b/CRM/Member/StateMachine/Search.php @@ -44,7 +44,7 @@ class CRM_Member_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/Upgrade/Snapshot/V4p2/Price/BAO/Set.php b/CRM/Upgrade/Snapshot/V4p2/Price/BAO/Set.php index 976729cbc0..212c23d1f4 100644 --- a/CRM/Upgrade/Snapshot/V4p2/Price/BAO/Set.php +++ b/CRM/Upgrade/Snapshot/V4p2/Price/BAO/Set.php @@ -252,7 +252,7 @@ WHERE ct.id = cp.contribution_type_id AND * @param int $id * Price Set id. * - * @return boolean + * @return bool * false if fields exist for this set, true if the * set could be deleted * @@ -767,7 +767,7 @@ WHERE id = %1"; * * @return void */ - static function buildPriceSet(&$form) { + public static function buildPriceSet(&$form) { $priceSetId = $form->get('priceSetId'); $userid = $form->getVar('_userID'); if (!$priceSetId) { @@ -778,7 +778,7 @@ WHERE id = %1"; $className = CRM_Utils_System::getClassName($form); if (in_array($className, array( 'CRM_Contribute_Form_Contribution', - 'CRM_Member_Form_Membership' + 'CRM_Member_Form_Membership', ))) { $validFieldsOnly = FALSE; } @@ -844,7 +844,7 @@ WHERE id = %1"; * check the current Membership * having end date null. */ - static function checkCurrentMembership(&$options, $userid) { + public static function checkCurrentMembership(&$options, $userid) { if (!$userid || empty($options)) { return; } @@ -878,7 +878,7 @@ WHERE id = %1"; * * @return array */ - static function setDefaultPriceSet(&$form, &$defaults) { + public static function setDefaultPriceSet(&$form, &$defaults) { if (!isset($form->_priceSet) || empty($form->_priceSet['fields'])) { return $defaults; } @@ -901,7 +901,7 @@ WHERE id = %1"; /** * Get field ids of a price set * - * @param int id Price Set id + * @param int $id Price Set id * * @return array * Array of the field ids @@ -925,7 +925,7 @@ WHERE id = %1"; * * @return CRM_Upgrade_Snapshot_V4p2_Price_DAO_Field */ - static function copy($id) { + public static function copy($id) { $maxId = CRM_Core_DAO::singleValueQuery("SELECT max(id) FROM civicrm_price_set"); $title = ts('[Copy id %1]', array(1 => $maxId + 1)); @@ -972,7 +972,7 @@ WHERE id = %1"; * * @return bool */ - function checkPermission($sid) { + public function checkPermission($sid) { if ($sid && self::eventPriceSetDomainID() ) { diff --git a/CRM/Utils/ReCAPTCHA.php b/CRM/Utils/ReCAPTCHA.php index d99b398a9c..cdefd36e62 100644 --- a/CRM/Utils/ReCAPTCHA.php +++ b/CRM/Utils/ReCAPTCHA.php @@ -53,7 +53,6 @@ class CRM_Utils_ReCAPTCHA { /** * Singleton function used to manage this object * - * @param string the key to permit session scope's * * @return object */ diff --git a/Civi/Install/Requirements.php b/Civi/Install/Requirements.php index 68c95cc4b1..9736b5a26d 100644 --- a/Civi/Install/Requirements.php +++ b/Civi/Install/Requirements.php @@ -282,7 +282,7 @@ class Requirements { $results = array( 'title' => 'CiviCRM InnoDB support', 'severity' => $this::REQUIREMENT_ERROR, - 'details' => 'Could not determine if MySQL has InnoDB support. Assuming none.' + 'details' => 'Could not determine if MySQL has InnoDB support. Assuming none.', ); $conn = @mysql_connect($db_config['host'], $db_config['username'], $db_config['password']); diff --git a/api/v3/Note.php b/api/v3/Note.php index 834cbc21e5..47d64a9345 100644 --- a/api/v3/Note.php +++ b/api/v3/Note.php @@ -94,7 +94,7 @@ function civicrm_api3_note_delete($params) { * array of properties, * if error an array with an error id and error message * - * {@getfields note_get} + * {@getfields note_get} */ function civicrm_api3_note_get($params) { diff --git a/tests/phpunit/CRM/Contact/Form/Search/Custom/GroupTest.php b/tests/phpunit/CRM/Contact/Form/Search/Custom/GroupTest.php index e24db3a3aa..57d3bad04d 100644 --- a/tests/phpunit/CRM/Contact/Form/Search/Custom/GroupTest.php +++ b/tests/phpunit/CRM/Contact/Form/Search/Custom/GroupTest.php @@ -69,7 +69,7 @@ class CRM_Contact_Form_Search_Custom_GroupTest extends CiviUnitTestCase { * @return CRM_Contact_Form_Search_Custom_GroupTestDataProvider */ public function dataProvider() { - return new CRM_Contact_Form_Search_Custom_GroupTestDataProvider; + return new CRM_Contact_Form_Search_Custom_GroupTestDataProvider(); } public function setUp() { diff --git a/tests/phpunit/CRM/Member/AllTests.php b/tests/phpunit/CRM/Member/AllTests.php index 269a5a6e51..a717716f0a 100644 --- a/tests/phpunit/CRM/Member/AllTests.php +++ b/tests/phpunit/CRM/Member/AllTests.php @@ -47,7 +47,7 @@ class CRM_Member_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/CRM/Member/BAO/MembershipTypeTest.php b/tests/phpunit/CRM/Member/BAO/MembershipTypeTest.php index 502233b3cc..a9c20abb56 100644 --- a/tests/phpunit/CRM/Member/BAO/MembershipTypeTest.php +++ b/tests/phpunit/CRM/Member/BAO/MembershipTypeTest.php @@ -63,9 +63,10 @@ class CRM_Member_BAO_MembershipTypeTest extends CiviUnitTestCase { $this->contactDelete($this->_indiviContactID); } - /* check function add() - * - */ + /** + * check function add() + * + */ public function testAdd() { $ids = array(); $params = array( @@ -93,9 +94,10 @@ class CRM_Member_BAO_MembershipTypeTest extends CiviUnitTestCase { $this->membershipTypeDelete(array('id' => $membershipType->id)); } - /* check function retrive() - * - */ + /** + * check function retrive() + * + */ public function testRetrieve() { $ids = array(); $params = array( @@ -120,9 +122,10 @@ class CRM_Member_BAO_MembershipTypeTest extends CiviUnitTestCase { $this->membershipTypeDelete(array('id' => $membershipType->id)); } - /* check function isActive() - * - */ + /** + * check function isActive() + * + */ public function testSetIsActive() { $ids = array(); $params = array( @@ -152,9 +155,10 @@ class CRM_Member_BAO_MembershipTypeTest extends CiviUnitTestCase { $this->membershipTypeDelete(array('id' => $membership->id)); } - /* check function del() - * - */ + /** + * check function del() + * + */ public function testdel() { $ids = array(); $params = array( @@ -178,9 +182,10 @@ class CRM_Member_BAO_MembershipTypeTest extends CiviUnitTestCase { $this->assertEquals($result, TRUE, 'Verify membership deleted.'); } - /* check function convertDayFormat( ) - * - */ + /** + * check function convertDayFormat( ) + * + */ public function testConvertDayFormat() { $ids = array(); $params = array( @@ -208,9 +213,10 @@ class CRM_Member_BAO_MembershipTypeTest extends CiviUnitTestCase { $this->membershipTypeDelete(array('id' => $membership->id)); } - /* check function getMembershipTypes( ) - * - */ + /** + * check function getMembershipTypes( ) + * + */ public function testGetMembershipTypes() { $ids = array(); $params = array( @@ -233,9 +239,10 @@ class CRM_Member_BAO_MembershipTypeTest extends CiviUnitTestCase { $this->membershipTypeDelete(array('id' => $membership->id)); } - /* check function getMembershipTypeDetails( ) - * - */ + /** + * check function getMembershipTypeDetails( ) + * + */ public function testGetMembershipTypeDetails() { $ids = array(); $params = array( @@ -260,9 +267,10 @@ class CRM_Member_BAO_MembershipTypeTest extends CiviUnitTestCase { $this->membershipTypeDelete(array('id' => $membership->id)); } - /* check function getDatesForMembershipType( ) - * - */ + /** + * check function getDatesForMembershipType( ) + * + */ public function testGetDatesForMembershipType() { $ids = array(); $params = array( @@ -286,9 +294,10 @@ class CRM_Member_BAO_MembershipTypeTest extends CiviUnitTestCase { $this->membershipTypeDelete(array('id' => $membership->id)); } - /* check function getRenewalDatesForMembershipType( ) - * - */ + /** + * check function getRenewalDatesForMembershipType( ) + * + */ public function testGetRenewalDatesForMembershipType() { $ids = array(); $params = array( @@ -329,9 +338,10 @@ class CRM_Member_BAO_MembershipTypeTest extends CiviUnitTestCase { $this->membershipTypeDelete(array('id' => $membershipType->id)); } - /* check function getMembershipTypesByOrg( ) - * - */ + /** + * check function getMembershipTypesByOrg( ) + * + */ public function testGetMembershipTypesByOrg() { $ids = array(); $params = array( diff --git a/tests/phpunit/WebTest/Member/OnlineMembershipAddPricesetTest.php b/tests/phpunit/WebTest/Member/OnlineMembershipAddPricesetTest.php index 52bb996290..238915dd74 100644 --- a/tests/phpunit/WebTest/Member/OnlineMembershipAddPricesetTest.php +++ b/tests/phpunit/WebTest/Member/OnlineMembershipAddPricesetTest.php @@ -325,7 +325,7 @@ class WebTest_Member_OnlineMembershipAddPricesetTest extends CiviSeleniumTestCas foreach (array( 'joinDate', 'startDate', - 'endDate' + 'endDate', ) as $date) { $$date = CRM_Utils_Date::customFormat($$date, $configVars->dateformatFull); } @@ -450,7 +450,7 @@ class WebTest_Member_OnlineMembershipAddPricesetTest extends CiviSeleniumTestCas foreach (array( 'joinDate', 'startDate', - 'endDate' + 'endDate', ) as $date) { $$date = CRM_Utils_Date::customFormat($$date, $configVars->dateformatFull); } diff --git a/tests/phpunit/api/v3/UFMatchTest.php b/tests/phpunit/api/v3/UFMatchTest.php index 30432e32f9..2d3c575784 100644 --- a/tests/phpunit/api/v3/UFMatchTest.php +++ b/tests/phpunit/api/v3/UFMatchTest.php @@ -56,7 +56,7 @@ class api_v3_UFMatchTest extends CiviUnitTestCase { ) ); $this->_contactId = $this->individualCreate(); - $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')