clean up fixes for batch 5
authoryashodha <yashodha.chaku@webaccessglobal.com>
Thu, 15 Jan 2015 07:05:01 +0000 (12:35 +0530)
committeryashodha <yashodha.chaku@webaccessglobal.com>
Thu, 15 Jan 2015 07:05:01 +0000 (12:35 +0530)
23 files changed:
CRM/Admin/Form/Mapping.php
CRM/Campaign/Form/Task.php
CRM/Contact/Form/Search/Custom/PriceSet.php
CRM/Contact/Import/Form/Preview.php
CRM/Contribute/Import/Form/Summary.php
CRM/Core/I18n/SchemaStructure_2_2_0.php
CRM/Core/Permission/Soap.php
CRM/Core/Smarty/plugins/block.crmRegion.php
CRM/Custom/Form/MoveField.php
CRM/Logging/Differ.php
CRM/Member/BAO/Query.php
CRM/Member/Form/MembershipBlock.php
CRM/Member/Form/Task/PickProfile.php
CRM/Member/StateMachine/Search.php
CRM/Upgrade/Snapshot/V4p2/Price/BAO/Set.php
CRM/Utils/ReCAPTCHA.php
Civi/Install/Requirements.php
api/v3/Note.php
tests/phpunit/CRM/Contact/Form/Search/Custom/GroupTest.php
tests/phpunit/CRM/Member/AllTests.php
tests/phpunit/CRM/Member/BAO/MembershipTypeTest.php
tests/phpunit/WebTest/Member/OnlineMembershipAddPricesetTest.php
tests/phpunit/api/v3/UFMatchTest.php

index ed1a99e5a9833097f5b959aaba2a4c99ebadd257..0ff7d2ef5afa6bd167f8404caf7fc3c83c269bce 100644 (file)
@@ -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'),
index 3fcab21335c564615a2af1df5b87f291df7d404b..f87ede84b452f4ea112776d4391b37f954796196 100755 (executable)
@@ -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'];
index ae6fd34e6e3864916ce6457d4f73e4b9a26e29b6..2830daa662d4fac1397b70a12eef5ae36f4b2010 100644 (file)
@@ -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
   ) {
index cd916b6636b90a8dbf97856fcb4cbbdd74014aa8..38b3f97b7c66439e58b8ea540cd1c1d42054d877 100644 (file)
@@ -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',
         ));
     }
 
index 0dd9e0bbbe0a55313c7e55fc5f21c93bad936e32..3377c217d6fb847557eb43e4b29c03475b86b036 100644 (file)
@@ -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));
index 73ddecbb0109295c730ee3fae5fa2036852f8bee..ea05322b81079f0d4712ee414989ac44475c6924 100644 (file)
@@ -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;}}}');
index 1b35fe8e55babf31695cd0a39703fdfbdfd4edb6..b28ed9c19fb945692f188a13b3f26149577a5664 100644 (file)
@@ -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;
   }
index 8ef43c03190dfc2b21e7019ded899a6f5f8d78a9..fb016e10b71b5e0898651bd0b3da5f5ef3ff0e7e 100644 (file)
@@ -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);
index fcfb6913fd94da3e40b565e5ee75653da53a4b97..0f9f22031f1f169af1c605f218edf37f2784daa2 100644 (file)
@@ -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'),
index 58c3697cee06ee547f2c07bc5d482517b6c39d71..08db3bbb5cae0202d433f344a0086b3b827cb772 100644 (file)
@@ -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);
 
index 1d14d1ca45a5e2275cade86d5a3b4ab0d81c2d22..6b29e33ee1647ec35587691f55044141bbf4a183 100644 (file)
@@ -392,7 +392,7 @@ class CRM_Member_BAO_Query {
    *
    * @return array|null
    */
-  static function defaultReturnProperties(
+  public static function defaultReturnProperties(
     $mode,
     $includeCustomFields = TRUE
   ) {
index 624411003d56a00046677445bda87570841ec60a..f5b6cca94b2d93d712267764e3f8523432d40c58 100644 (file)
@@ -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') {
index 91ae8b9529ddf0cc57f08249eb84255df33557ed..5081749e1716fbb9e32340c5c9138b8f4cc5b627 100644 (file)
@@ -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'));
index c3f8ce5e0e6434daf395ea53626a18c10b909407..eef573eccb88c74e1f60262bba48dfdac55ec737 100644 (file)
@@ -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();
index 976729cbc033991569fc10d536fa69cf2c1c9f50..212c23d1f47236b5bdf5b34f02bb44ac87369db6 100644 (file)
@@ -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()
     ) {
index d99b398a9c3c95375f3f91ac89e68a84bf48fee5..cdefd36e62bbb79431ec77446e9ca121adc64ac1 100644 (file)
@@ -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
    */
index 68c95cc4b1996a1b61cd0bd7c81badcde2ee98af..9736b5a26d2e2113974f495891322c1bdf4aee58 100644 (file)
@@ -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']);
index 834cbc21e551e7d5444fe560b4eaff8f0e357e00..47d64a93457ffa994880bc15eb13672e8c0e95fe 100644 (file)
@@ -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) {
 
index e24db3a3aa102ddaadb00fea15ce8855322e7720..57d3bad04d59d48ed734036f91b5099d38dd7bc4 100644 (file)
@@ -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() {
index 269a5a6e51ab494889b1eefda66549578f518c18..a717716f0ab0cbf19ca7119066620df6f9e83a91 100644 (file)
@@ -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;
   }
index 502233b3cc6fd201adc9fb403b0b5d4f4f35076d..a9c20abb56a1d682497a6eba3d5854648886b429 100644 (file)
@@ -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(
index 52bb99629074570d8748fe73cf21655e9dda768e..238915dd74c31d8528b5cc43324439ecf462a465 100644 (file)
@@ -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);
     }
index 30432e32f9f385682e0e7f9d4dddda14c1a3065a..2d3c575784dfb0aa1ed60886c988cb8d5d5bd22a 100644 (file)
@@ -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')