Coding standards cleanup sprint.
authorChris Burgess <chris@giantrobot.co.nz>
Tue, 20 Jan 2015 00:42:53 +0000 (13:42 +1300)
committerChris Burgess <chris@giantrobot.co.nz>
Tue, 20 Jan 2015 00:42:53 +0000 (13:42 +1300)
See https://pad.riseup.net/p/QOOHQpetSXXo

This is batch 12.

44 files changed:
CRM/Activity/Page/Tab.php
CRM/Activity/Selector/Activity.php
CRM/Admin/Form/MessageTemplates.php
CRM/Admin/Form/Options.php
CRM/Campaign/BAO/Survey.php
CRM/Campaign/Form/Petition/Signature.php
CRM/Case/Form/CaseView.php
CRM/Case/Selector/Search.php
CRM/Contact/Form/Search/Custom/ContribSYBNT.php
CRM/Contact/Form/Search/Custom/Sample.php
CRM/Contact/Form/Task/Merge.php
CRM/Contribute/Selector/Search.php
CRM/Core/BAO/CustomValue.php
CRM/Core/BAO/EntityTag.php
CRM/Core/BAO/OpenID.php
CRM/Core/BAO/SchemaHandler.php
CRM/Core/CodeGen/Config.php
CRM/Core/Config.php
CRM/Core/Form/Date.php
CRM/Core/OptionValue.php
CRM/Core/Page.php
CRM/Core/Payment/PayPalIPN.php
CRM/Core/PseudoConstant.php
CRM/Core/Resources.php
CRM/Custom/Page/Field.php
CRM/Event/Import/Parser.php
CRM/Event/Page/EventInfo.php
CRM/Grant/Form/Search.php
CRM/Mailing/Event/BAO/Subscribe.php
CRM/SMS/Form/Schedule.php
CRM/Utils/DeprecatedUtils.php
tests/phpunit/CRM/Case/AllTests.php
tests/phpunit/CRM/Core/BAO/CustomValueTableTest.php
tests/phpunit/WebTest/Admin/MoveCustomDataTest.php
tests/phpunit/WebTest/Contact/CreateCmsUserFromContactTest.php
tests/phpunit/WebTest/Event/AddParticipationTest.php
tests/phpunit/WebTest/Import/DateFormatTest.php
tests/phpunit/WebTest/Import/MultipleRelationshipTest.php
tests/phpunit/WebTest/Profile/ProfileCountryState.php
tests/phpunit/api/v3/EmailTest.php
tests/phpunit/api/v3/GroupNestingTest.php
tests/phpunit/api/v3/MembershipTypeTest.php
tests/phpunit/api/v3/OptionGroupTest.php
tests/qunit/example/test.js

index 6686de71d0d7149592073d8ef3c48cc6ddf7350a..7bca74670470be8a50d2b30d3340733f4464e207 100644 (file)
@@ -204,7 +204,7 @@ class CRM_Activity_Page_Tab extends CRM_Core_Page {
 
       if (in_array($activityTypeId, array(
         $emailTypeValue,
-        $letterTypeValue
+        $letterTypeValue,
       ))) {
         return;
       }
index 4187319007295284ab1cbf7c5aa115c3c6d5df62..9623906d932601768f912171c7662c16357f1a9f 100644 (file)
@@ -75,7 +75,7 @@ class CRM_Activity_Selector_Activity extends CRM_Core_Selector_Base implements C
    *
    * @return \CRM_Activity_Selector_Activity
    */
-  function __construct(
+  public function __construct(
     $contactId,
     $permission,
     $admin = FALSE,
@@ -221,7 +221,7 @@ class CRM_Activity_Selector_Activity extends CRM_Core_Selector_Base implements C
           'url' => $url,
           'qs' => $qsView,
           'title' => ts('View Activity'),
-        )
+        ),
       );
     }
 
@@ -241,7 +241,7 @@ class CRM_Activity_Selector_Activity extends CRM_Core_Selector_Base implements C
             'url' => $updateUrl,
             'qs' => $qsUpdate,
             'title' => ts('Update Activity'),
-          )
+          ),
         );
       }
     }
@@ -257,7 +257,7 @@ class CRM_Activity_Selector_Activity extends CRM_Core_Selector_Base implements C
           'url' => '#',
           'extra' => 'onclick="javascript:fileOnCase( \'file\', \'%%id%%\', null, this ); return false;"',
           'title' => ts('File on Case'),
-        )
+        ),
       );
     }
 
@@ -272,7 +272,7 @@ class CRM_Activity_Selector_Activity extends CRM_Core_Selector_Base implements C
           'url' => $delUrl,
           'qs' => $qsDelete,
           'title' => ts('Delete Activity'),
-        )
+        ),
       );
     }
 
@@ -284,7 +284,7 @@ class CRM_Activity_Selector_Activity extends CRM_Core_Selector_Base implements C
           'url' => 'civicrm/mailing/report',
           'qs' => "mid={$sourceRecordId}&reset=1&cid=%%cid%%&context=activitySelector",
           'title' => ts('View Mailing Report'),
-        )
+        ),
       );
     }
 
index 0f24a14b88263efa8fe7d87e6088d830fad7e8ff..840028de0d7a510658e6b70381f4d87cf0feb214 100644 (file)
@@ -144,7 +144,7 @@ class CRM_Admin_Form_MessageTemplates extends CRM_Admin_Form {
         'url' => CRM_Utils_System::url('civicrm/admin/messageTemplates',
           'action=browse&reset=1'
         ),
-      )
+      ),
     );
     CRM_Utils_System::appendBreadCrumb($breadCrumb);
 
@@ -188,7 +188,7 @@ class CRM_Admin_Form_MessageTemplates extends CRM_Admin_Form {
 
     $this->add('select', 'pdf_format_id', ts('PDF Page Format'),
       array(
-        'null' => ts('- default -')
+        'null' => ts('- default -'),
       ) + CRM_Core_BAO_PdfFormat::getList(TRUE), FALSE
     );
 
index 375e91bac2ad71308d3b40f1021611603f322a67..881fd8931e2a6a044baaa24125f049d3ce743cfe 100644 (file)
@@ -95,7 +95,7 @@ class CRM_Admin_Form_Options extends CRM_Admin_Form {
         $scriptURL = "<a href='" . CRM_Utils_System::docURL2('Update Greetings and Address Data for Contacts', TRUE, NULL, NULL, NULL, "wiki") . "'>" . ts('Learn more about a script that can automatically update contact addressee and greeting options.') . "</a>";
         CRM_Core_Session::setStatus(ts('The selected %1 option has <strong>not been deleted</strong> because it is currently in use. Please update these contacts to use a different format before deleting this option. %2', array(
               1 => $this->_gLabel,
-              2 => $scriptURL
+              2 => $scriptURL,
             )), ts('Sorry'), 'error');
         $redirect = CRM_Utils_System::url($url, $params);
         CRM_Utils_System::redirect($redirect);
@@ -132,7 +132,7 @@ class CRM_Admin_Form_Options extends CRM_Admin_Form {
     if (in_array($this->_gName, array(
       'email_greeting',
       'postal_greeting',
-      'addressee'
+      'addressee',
     ))) {
       $defaults['contactOptions'] = (CRM_Utils_Array::value('filter', $defaults)) ? $defaults['filter'] : NULL;
     }
@@ -173,7 +173,7 @@ class CRM_Admin_Form_Options extends CRM_Admin_Form {
     if (!in_array($this->_gName, array(
         'email_greeting',
         'postal_greeting',
-        'addressee'
+        'addressee',
       )) && !$isReserved
     ) {
       $this->addRule('label',
@@ -304,7 +304,7 @@ class CRM_Admin_Form_Options extends CRM_Admin_Form {
     if (in_array($this->_gName, array(
         'email_greeting',
         'postal_greeting',
-        'addressee'
+        'addressee',
       )) && !$isReserved
     ) {
       $values = array(
@@ -352,7 +352,7 @@ class CRM_Admin_Form_Options extends CRM_Admin_Form {
     if (in_array($self->_gName, array(
           'email_greeting',
           'postal_greeting',
-          'addressee'
+          'addressee',
         )) && empty($self->_defaultValues['is_reserved'])
     ) {
       $label = $fields['label'];
@@ -455,7 +455,7 @@ class CRM_Admin_Form_Options extends CRM_Admin_Form {
 
       CRM_Core_Session::setStatus(ts('The %1 \'%2\' has been saved.', array(
             1 => $this->_gLabel,
-            2 => $optionValue->label
+            2 => $optionValue->label,
           )), ts('Saved'), 'success');
     }
   }
index 96661f31b20117e7571c50a1cc47547dbdd5a61b..ed45ec00fb86c477411d85cac643a49c1d862348 100644 (file)
@@ -306,14 +306,9 @@ SELECT  survey.id    as id,
   }
 
   /**
-   * Get Surveys activity types
-   *
-   *
+   * Get Survey activity types.
    */
-  static function getSurveyActivityType(
-    $returnColumn = 'label',
-    $includePetitionActivityType = FALSE
-  ) {
+  public static function getSurveyActivityType($returnColumn = 'label', $includePetitionActivityType = FALSE) {
     static $activityTypes;
     $cacheKey = "{$returnColumn}_{$includePetitionActivityType}";
 
@@ -449,7 +444,7 @@ SELECT  survey.id    as id,
     foreach ($returnProperties as $property => $ignore) {
       $value = (in_array($property, array(
         'city',
-        'street_address'
+        'street_address',
       ))) ? 'address' : $property;
       switch ($property) {
         case 'sort_name':
@@ -522,9 +517,7 @@ Group By  contact.id";
    * @return array
    *   array of survey activity.
    */
-  static function voterActivityDetails(
-    $surveyId, $voterIds, $interviewerId = NULL,
-    $statusIds = array()) {
+  public static function voterActivityDetails($surveyId, $voterIds, $interviewerId = NULL, $statusIds = array()) {
     $activityDetails = array();
     if (!$surveyId ||
       !is_array($voterIds) || empty($voterIds)
@@ -585,7 +578,7 @@ INNER JOIN  civicrm_activity_contact activityAssignment
    * @return array
    *   An array of survey activity.
    */
-  static function getSurveyActivities(
+  public static function getSurveyActivities(
     $surveyId,
     $interviewerId = NULL,
     $statusIds = NULL,
@@ -742,7 +735,7 @@ INNER JOIN  civicrm_contact contact_a ON ( activityTarget.contact_id = contact_a
    *
    * @param int $activityId
    *   Activity id.
-   * @return boolean
+   * @return bool
    */
   public static function isSurveyActivity($activityId) {
     $isSurveyActivity = FALSE;
@@ -840,13 +833,12 @@ INNER JOIN  civicrm_contact contact_a ON ( activityTarget.contact_id = contact_a
     if (CRM_Core_Permission::check('access CiviReport')) {
       $reportID = self::getReportID($surveyId);
       if ($reportID) {
-        $voterLinks['report'] =
-          array(
-            'name' => 'report',
-            'url' => "civicrm/report/instance/{$reportID}",
-            'qs' => 'reset=1',
-            'title' => ts('View Survey Report'),
-          );
+        $voterLinks['report'] = array(
+          'name' => 'report',
+          'url' => "civicrm/report/instance/{$reportID}",
+          'qs' => 'reset=1',
+          'title' => ts('View Survey Report'),
+        );
       }
     }
 
index 1fe046fcad08f819e18f56064a8fa47dd0fa72b6..a4ee3f0d0c7a996d303312ad5cec976d04d2b320 100644 (file)
@@ -221,7 +221,6 @@ class CRM_Campaign_Form_Petition_Signature extends CRM_Core_Form {
       CRM_Core_Error::fatal('The contact profile needs to contain the primary email address field');
     }
 
-
     $ufJoinParams['weight'] = 1;
     $this->_activityProfileId = CRM_Core_BAO_UFJoin::findUFGroupId($ufJoinParams);
 
@@ -326,7 +325,6 @@ class CRM_Campaign_Form_Petition_Signature extends CRM_Core_Form {
    * @return void
    * @see valid_date
    */
-
   public static function formRule($fields, $files, $errors) {
     $errors = array();
 
@@ -344,7 +342,6 @@ class CRM_Campaign_Form_Petition_Signature extends CRM_Core_Form {
       'tag_unconfirmed'
     );
 
-
     if ($tag_name) {
       // Check if contact 'email confirmed' tag exists, else create one
       // This should be in the petition module initialise code to create a default tag for this
@@ -496,7 +493,6 @@ class CRM_Campaign_Form_Petition_Signature extends CRM_Core_Form {
         break;
     }
 
-
     $transaction = new CRM_Core_Transaction();
 
     $addToGroupID = isset($this->_addToGroupID) ? $this->_addToGroupID : NULL;
@@ -570,11 +566,10 @@ class CRM_Campaign_Form_Petition_Signature extends CRM_Core_Form {
       $this->postProcessHook();
 
       // set the template to thank you
-      $url =
-        CRM_Utils_System::url(
-          'civicrm/petition/thankyou',
-          'pid=' . $this->_surveyId . '&id=' . $this->_sendEmailMode . '&reset=1'
-        );
+      $url = CRM_Utils_System::url(
+        'civicrm/petition/thankyou',
+        'pid=' . $this->_surveyId . '&id=' . $this->_sendEmailMode . '&reset=1'
+      );
       CRM_Utils_System::redirect($url);
     }
   }
@@ -608,16 +603,6 @@ class CRM_Campaign_Form_Petition_Signature extends CRM_Core_Form {
       }
 
       if ($fields) {
-        /*
-                // unset any email-* fields since we already collect it, CRM-2888
-                foreach ( array_keys( $fields ) as $fieldName ) {
-                    if ( substr( $fieldName, 0, 6 ) == 'email-' ) {
-                        unset( $fields[$fieldName] );
-                    }
-                }
-                */
-
-
         $this->assign($name, $fields);
 
         $addCaptcha = FALSE;
index 94e4978c53added6907aef7a76a803c46591984d..41368eeb27d4b0df5967a0bce30e320b0a25a371 100644 (file)
@@ -170,7 +170,7 @@ class CRM_Case_Form_CaseView extends CRM_Core_Form {
     if ($relatedCases) {
       $this->assign('relatedCaseLabel', ts('%1 Related Case', array(
             'count' => count($relatedCases),
-            'plural' => '%1 Related Cases'
+            'plural' => '%1 Related Cases',
           )));
       $this->assign('relatedCaseUrl', CRM_Utils_System::url('civicrm/contact/view/case', array(
         'id' => $this->_caseID,
@@ -312,7 +312,7 @@ class CRM_Case_Form_CaseView extends CRM_Core_Form {
         $this->add('select', 'merge_case_id',
           ts('Select Case for Merge'),
           array(
-            '' => ts('- select case -')
+            '' => ts('- select case -'),
           ) + $otherCases,
           FALSE,
           array('class' => 'crm-select2 huge')
index 2320e1ff21d5b698c492c2f2e7367dd5e65a6912..30717d1886678c9836c5da9362d7df334fa6639c 100644 (file)
@@ -141,7 +141,7 @@ class CRM_Case_Selector_Search extends CRM_Core_Selector_Base {
    *
    * @return \CRM_Case_Selector_Search
    */
-  function __construct(
+  public function __construct(
     &$queryParams,
     $action = CRM_Core_Action::NONE,
     $additionalClause = NULL,
@@ -185,8 +185,7 @@ class CRM_Case_Selector_Search extends CRM_Core_Selector_Base {
    *
    * @return array
    */
-  static
-  public function &links($isDeleted = FALSE, $key = NULL) {
+  static public function &links($isDeleted = FALSE, $key = NULL) {
     $extraParams = ($key) ? "&key={$key}" : NULL;
 
     if ($isDeleted) {
index 79ca97a975561e356182ee94edd62f9ee182c12b..4283f2c10a7a5c60b6fb4c34310f7b0a4bf015e2 100644 (file)
@@ -144,7 +144,7 @@ class CRM_Contact_Form_Search_Custom_ContribSYBNT implements CRM_Contact_Form_Se
    *
    * @return string
    */
-  function all(
+  public function all(
     $offset = 0,
     $rowcount = 0,
     $sort = NULL,
@@ -191,7 +191,6 @@ GROUP BY   contact_a.id
 ORDER BY   donation_amount desc
 ";
 
-
     if ($justIDs) {
       CRM_Core_DAO::executeQuery("DROP TEMPORARY TABLE IF EXISTS CustomSearch_SYBNT_temp");
       $query = "CREATE TEMPORARY TABLE CustomSearch_SYBNT_temp AS ({$sql})";
index 627a74913927df5a8cfe2c5fefd81ad1dc5bdd15..0917cefe0568c7e69c9b2c96a5e019b9bb86dde3 100644 (file)
@@ -106,10 +106,7 @@ class CRM_Contact_Form_Search_Custom_Sample extends CRM_Contact_Form_Search_Cust
    *
    * @return string
    */
-  function all(
-    $offset = 0, $rowcount = 0, $sort = NULL,
-    $includeContactIDs = FALSE, $justIDs = FALSE
-  ) {
+  public function all($offset = 0, $rowcount = 0, $sort = NULL, $includeContactIDs = FALSE, $justIDs = FALSE) {
     if ($justIDs) {
       $selectClause = "contact_a.id as contact_id";
       $sort = 'contact_a.id';
index c8099dce4da6cb56aef74b33a3c61423af651da1..418b8e35b7c6ccd3534f601c77bf693dc3374a68 100644 (file)
@@ -62,8 +62,9 @@ class CRM_Contact_Form_Task_Merge extends CRM_Contact_Form_Task {
       $contact = CRM_Core_DAO::executeQuery($sql);
       while ($contact->fetch()) {
         $contactTypes[$contact->contact_type] = TRUE;
-        if (count($contactTypes) > 1)
+        if (count($contactTypes) > 1) {
           break;
+        }
       }
       if (count($contactTypes) > 1) {
         $statusMsg = ts('Selected records must all be the same contact type (i.e. all Individuals).');
index 3da2901603211207ed213d27157726de87725cc0..b4d45e5d26b138a8a67921afa08434a3f8dbeae3 100644 (file)
@@ -163,7 +163,7 @@ class CRM_Contribute_Selector_Search extends CRM_Core_Selector_Base implements C
    *
    * @return \CRM_Contribute_Selector_Search
    */
-  function __construct(
+  public function __construct(
     &$queryParams,
     $action = CRM_Core_Action::NONE,
     $contributionClause = NULL,
@@ -451,8 +451,8 @@ class CRM_Contribute_Selector_Search extends CRM_Core_Selector_Base implements C
       ),
     );
     if ($this->_includeSoftCredits) {
-      self::$_columnHeaders =
-        array_merge(
+      self::$_columnHeaders
+        array_merge(
           self::$_columnHeaders,
           array(
             array(
@@ -463,8 +463,8 @@ class CRM_Contribute_Selector_Search extends CRM_Core_Selector_Base implements C
           )
         );
     }
-    self::$_columnHeaders =
-      array_merge(
+    self::$_columnHeaders
+      array_merge(
         self::$_columnHeaders,
         array(
           array(
@@ -511,25 +511,25 @@ class CRM_Contribute_Selector_Search extends CRM_Core_Selector_Base implements C
       self::$_columnHeaders = array_merge($pre, self::$_columnHeaders);
     }
     if ($this->_includeSoftCredits) {
-      self::$_columnHeaders =
-        array_merge(
-          self::$_columnHeaders,
+      self::$_columnHeaders
+        = array_merge(
+        self::$_columnHeaders,
+        array(
           array(
-            array(
-              'name' => ts('Soft Credit For'),
-              'sort' => 'contribution_soft_credit_name',
-              'direction' => CRM_Utils_Sort::DONTCARE,
-            ),
-            array(
-              'name' => ts('Soft Credit Type'),
-              'sort' => 'contribution_soft_credit_type',
-              'direction' => CRM_Utils_Sort::ASCENDING,
-            ),
-          )
-        );
+            'name' => ts('Soft Credit For'),
+            'sort' => 'contribution_soft_credit_name',
+            'direction' => CRM_Utils_Sort::DONTCARE,
+          ),
+          array(
+            'name' => ts('Soft Credit Type'),
+            'sort' => 'contribution_soft_credit_type',
+            'direction' => CRM_Utils_Sort::ASCENDING,
+          ),
+        )
+      );
     }
-    self::$_columnHeaders =
-      array_merge(
+    self::$_columnHeaders
+      array_merge(
         self::$_columnHeaders, array(
           array('desc' => ts('Actions')),
         )
@@ -571,4 +571,3 @@ class CRM_Contribute_Selector_Search extends CRM_Core_Selector_Base implements C
     return $this->_query->summaryContribution($this->_context);
   }
 }
-
index 156b96220359b2627d6337300e932c423ce6e851..98914b549dcc0638c8b44050921e5dd04b0f4d01 100644 (file)
@@ -47,7 +47,7 @@ class CRM_Core_BAO_CustomValue extends CRM_Core_DAO {
    * @param string $value
    *   The data to be validated.
    *
-   * @return boolean
+   * @return bool
    *   True if the value is of the specified type
    */
   public static function typecheck($type, $value) {
index c0ef14f1f3c51f547e1dbc46c9aa665a0e686e08..88561556d57b76927df8c51c5893fc39d179276c 100644 (file)
@@ -45,8 +45,8 @@ class CRM_Core_BAO_EntityTag extends CRM_Core_DAO_EntityTag {
    * @param string $entityTable
    *   Name of the entity table usually 'civicrm_contact'.
    *
-   * @return array(
-   * ) reference $tag array of category id's the contact belongs to.
+   * @return array
+   *   reference $tag array of category id's the contact belongs to.
    *
    */
   public static function &getTag($entityID, $entityTable = 'civicrm_contact') {
@@ -103,7 +103,7 @@ class CRM_Core_BAO_EntityTag extends CRM_Core_DAO_EntityTag {
    * @param array $params
    *   An assoc array of name/value pairs.
    *
-   * @return boolean
+   * @return bool
    */
   public static function dataExists($params) {
     return !($params['tag_id'] == 0);
@@ -114,8 +114,6 @@ class CRM_Core_BAO_EntityTag extends CRM_Core_DAO_EntityTag {
    *
    * @param array $params
    *   (reference ) an assoc array of name/value pairs.
-   *
-   * @return CRM_Core_BAO_EntityTag
    */
   public static function del(&$params) {
     $entityTag = new CRM_Core_BAO_EntityTag();
@@ -390,15 +388,17 @@ class CRM_Core_BAO_EntityTag extends CRM_Core_DAO_EntityTag {
 
   /**
    * Get options for a given field.
+   *
    * @see CRM_Core_DAO::buildOptions
+   * @see CRM_Core_DAO::buildOptionsContext
    *
    * @param string $fieldName
    * @param string $context
-   *   @see CRM_Core_DAO::buildOptionsContext.
+   *   As per CRM_Core_DAO::buildOptionsContext.
    * @param array $props
    *   whatever is known about this dao object.
    *
-   * @return Array|bool
+   * @return array|bool
    */
   public static function buildOptions($fieldName, $context = NULL, $props = array()) {
     $params = array();
index 73eca2856c616ec2911f911b4a5b875f630a10d5..5960974bda336ffd380ee70480f03fd7a6b814ec 100644 (file)
@@ -78,7 +78,7 @@ class CRM_Core_BAO_OpenID extends CRM_Core_DAO_OpenID {
    * @param string $identity_url
    *   The OpenID to check.
    *
-   * @return boolean
+   * @return bool
    */
   public static function isAllowedToLogin($identity_url) {
     $openId = new CRM_Core_DAO_OpenID();
index 5e0e52eea2bbcc6807bd3694d37c24b394591440..04875b81fdf597527740a6d66320577e63a3cd32 100644 (file)
@@ -79,7 +79,7 @@ class CRM_Core_BAO_SchemaHandler {
     $config = CRM_Core_Config::singleton();
     if ($config->logging) {
       // logging support
-      $logging = new CRM_Logging_Schema;
+      $logging = new CRM_Logging_Schema();
       $logging->fixSchemaDifferencesFor($params['name'], NULL, FALSE);
     }
 
@@ -348,7 +348,7 @@ ALTER TABLE {$tableName}
     if ($config->logging) {
       // logging support: if we’re adding a column (but only then!) make sure the potential relevant log table gets a column as well
       if ($params['operation'] == 'add') {
-        $logging = new CRM_Logging_Schema;
+        $logging = new CRM_Logging_Schema();
         $logging->fixSchemaDifferencesFor($params['table_name'], array('ADD' => array($params['name'])), FALSE);
       }
     }
@@ -361,14 +361,10 @@ ALTER TABLE {$tableName}
   }
 
   /**
-   * Delete a civiCRM-table
+   * Delete a CiviCRM-table
    *
    * @param string $tableName
    *   Name of the table to be created.
-   *
-   * @return bool
-   *   TRUE if successfully deleted, FALSE otherwise.
-   *
    */
   public static function dropTable($tableName) {
     $sql = "DROP TABLE $tableName";
@@ -410,7 +406,7 @@ ADD UNIQUE INDEX `unique_entity_id` ( `entity_id` )";
   public static function createIndexes(&$tables, $createIndexPrefix = 'index', $substrLenghts = array()) {
     $queries = array();
     require_once 'CRM/Core/DAO/Domain.php';
-    $domain = new CRM_Core_DAO_Domain;
+    $domain = new CRM_Core_DAO_Domain();
     $domain->find(TRUE);
     $locales = explode(CRM_Core_DAO::VALUE_SEPARATOR, $domain->locales);
 
@@ -440,7 +436,7 @@ ADD UNIQUE INDEX `unique_entity_id` ( `entity_id` )";
           "index_{$field}{$lengthName}",
           "FK_{$table}_{$field}{$lengthName}",
           "UI_{$field}{$lengthName}",
-          "{$createIndexPrefix}_{$field}{$lengthName}"
+          "{$createIndexPrefix}_{$field}{$lengthName}",
         );
 
         // skip to the next $field if one of the above $names exists; handle multilingual for CRM-4126
@@ -465,7 +461,7 @@ ADD UNIQUE INDEX `unique_entity_id` ( `entity_id` )";
     }
 
     // run the queries without i18n-rewriting
-    $dao = new CRM_Core_DAO;
+    $dao = new CRM_Core_DAO();
     foreach ($queries as $query) {
       $dao->query($query, FALSE);
     }
index 2f0627a195decd3f3cfe140c92d73b6735305770..dfa58413d29e99b0fdd67c789fbe5104ae436557 100644 (file)
@@ -18,9 +18,8 @@ class CRM_Core_CodeGen_Config extends CRM_Core_CodeGen_BaseTask {
     if (!in_array($this->config->cms, array(
       'drupal',
       'joomla',
-      'wordpress'
-    ))
-    ) {
+      'wordpress',
+    ))) {
       echo "Config file for '{$this->config->cms}' not known.";
       exit();
     }
index 984d4dbd3f2acb05bacdaf94ce15a6fa5fd7713e..6abd64a050391f51d2cb47e369dae21784904716 100644 (file)
@@ -211,7 +211,7 @@ class CRM_Core_Config extends CRM_Core_Config_Variables {
       self::$_singleton = $cache->get('CRM_Core_Config' . CRM_Core_Config::domainID());
       // if not in cache, fire off config construction
       if (!self::$_singleton) {
-        self::$_singleton = new CRM_Core_Config;
+        self::$_singleton = new CRM_Core_Config();
         self::$_singleton->_initialize($loadFromDB);
 
         //initialize variables. for gencode we cannot load from the
@@ -358,8 +358,8 @@ class CRM_Core_Config extends CRM_Core_Config_Variables {
 
       // also make sure we create the config directory within this directory
       // the below statement will create both the templates directory and the config and log directory
-      $this->configAndLogDir =
-        CRM_Utils_File::baseFilePath($this->templateCompileDir) .
+      $this->configAndLogDir
+        CRM_Utils_File::baseFilePath($this->templateCompileDir) .
         'ConfigAndLog' . DIRECTORY_SEPARATOR;
       CRM_Utils_File::createDir($this->configAndLogDir);
       CRM_Utils_File::restrictAccess($this->configAndLogDir);
@@ -658,7 +658,7 @@ class CRM_Core_Config extends CRM_Core_Config_Variables {
                $this->templateCompileDir,
                $this->uploadDir,
                $this->configAndLogDir,
-               $this->customFileUploadDir
+               $this->customFileUploadDir,
              ) as $dir) {
       if ($dir && is_dir($dir)) {
         CRM_Utils_File::restrictAccess($dir);
@@ -669,10 +669,10 @@ class CRM_Core_Config extends CRM_Core_Config_Variables {
   /**
    * Verify that the needed parameters are not null in the config
    *
-   * @param CRM_Core_Config (reference ) the system config object
-   * @param array (reference ) the parameters that need a value
+   * @param CRM_Core_Config $config (reference) the system config object
+   * @param array $required (reference) the parameters that need a value
    *
-   * @return boolean
+   * @return bool
    */
   public static function check(&$config, &$required) {
     foreach ($required as $name) {
index 5ddb2a6592bf68ccc4c4b2a921af112b01918702..926666803e9df3fd35a4d5232ea5c8edb59231a3 100644 (file)
@@ -86,17 +86,15 @@ class CRM_Core_Form_Date {
    * @param string $dateFormat
    * @param bool|string $displayTime
    *
-   *
    */
-
-  static function buildDateRange(
+  public static function buildDateRange(
     &$form, $fieldName, $count = 1,
     $from = '_from', $to = '_to', $fromLabel = 'From:',
     $required = FALSE, $operators = array(),
     $dateFormat = 'searchDate', $displayTime = FALSE
   ) {
-    $selector =
-      CRM_Core_Form_Date::returnDateRangeSelector(
+    $selector
+      CRM_Core_Form_Date::returnDateRangeSelector(
         $form, $fieldName, $count,
         $from, $to, $fromLabel,
         $required, $operators,
@@ -128,77 +126,75 @@ class CRM_Core_Form_Date {
    * @return array
    *   Values for Selector
    */
-  static function returnDateRangeSelector(
+  public static function returnDateRangeSelector(
     &$form, $fieldName, $count = 1,
     $from = '_from', $to = '_to', $fromLabel = 'From:',
     $required = FALSE, $operators = array(),
     $dateFormat = 'searchDate', $displayTime = FALSE
   ) {
-    $selector =
-      array(
-        '' => ts('- any -'),
-        0 => ts('Choose Date Range'),
-        'previous_2.year' => ts('Previous 2 Years'),
-        'previous_2.quarter' => ts('Previous 2 Quarters'),
-        'previous_2.month' => ts('Previous 2 Months'),
-        'previous_2.week' => ts('Previous 2 Weeks'),
-        'previous_2.day' => ts('Previous 2 Days'),
-        'previous_before.year' => ts('Prior to Previous Year'),
-        'previous_before.quarter' => ts('Prior to Previous Quarter'),
-        'previous_before.month' => ts('Prior to Previous Month'),
-        'previous_before.week' => ts('Prior to Previous Week'),
-        'previous_before.day' => ts('Prior to Previous Day'),
-        'previous.year' => ts('Previous Year'),
-        'previous.fiscal_year' => ts('Previous Fiscal Year'),
-        'previous.quarter' => ts('Previous Quarter'),
-        'previous.month' => ts('Previous Month'),
-        'previous.week' => ts('Previous Week'),
-        'earlier.year' => ts('To End of Previous Year'),
-        'earlier.quarter' => ts('To End of Previous Quarter'),
-        'earlier.month' => ts('To End of Previous Month'),
-        'earlier.week' => ts('To End of Previous Week'),
-        'earlier.day' => ts('To End of Previous Day'),
-        'greater_previous.year' => ts('From End of Previous Year'),
-        'greater_previous.quarter' => ts('From End of Previous Quarter'),
-        'greater_previous.month' => ts('From End of Previous Month'),
-        'greater_previous.week' => ts('From End of Previous Week'),
-        'greater.year' => ts('From Start of Current Year'),
-        'greater.quarter' => ts('From Start of Current Quarter'),
-        'greater.month' => ts('From Start of Current Month'),
-        'greater.week' => ts('From Start of Current Week'),
-        'greater.day' => ts('From Start of Current Day'),
-        'current.year' => ts('Current Year to-date'),
-        'current.quarter' => ts('Current Quarter to-date'),
-        'current.month' => ts('Current Month to-date'),
-        'current.week' => ts('Current Week to-date'),
-        'ending_3.year' => ts('Last 3 Years'),
-        'ending_2.year' => ts('Last 2 Years'),
-        'ending.year' => ts('Last 12 Months'),
-        'ending.quarter' => ts('Last 3 Months'),
-        'ending.month' => ts('Last Month'),
-        'ending.week' => ts('Last 7 days'),
-        'previous.day' => ts('Yesterday'),
-        'this.year' => ts('This Year'),
-        'this.fiscal_year' => ts('This Fiscal Year'),
-        'this.quarter' => ts('This Quarter'),
-        'this.month' => ts('This Month'),
-        'this.week' => ts('This Week'),
-        'this.day' => ts('Today'),
-        'starting.day' => ts('Tomorrow'),
-        'starting.week' => ts('Upcoming 7 days'),
-        'starting.month' => ts('Upcoming Month'),
-        'starting.year' => ts('Upcoming 12 Months'),
-        'less.year' => ts('To End of Current Year'),
-        'less.quarter' => ts('To End of Current Quarter'),
-        'less.month' => ts('To End of Current Month'),
-        'less.week' => ts('To End of Current Week'),
-        'next.week' => ts('Next Week'),
-        'next.month' => ts('Next Month'),
-        'next.quarter' => ts('Next Quarter'),
-        'next.fiscal_year' => ts('Next Fiscal Year'),
-        'next.year' => ts('Next Year'),
-
-      );
+    $selector = array(
+      '' => ts('- any -'),
+      0 => ts('Choose Date Range'),
+      'previous_2.year' => ts('Previous 2 Years'),
+      'previous_2.quarter' => ts('Previous 2 Quarters'),
+      'previous_2.month' => ts('Previous 2 Months'),
+      'previous_2.week' => ts('Previous 2 Weeks'),
+      'previous_2.day' => ts('Previous 2 Days'),
+      'previous_before.year' => ts('Prior to Previous Year'),
+      'previous_before.quarter' => ts('Prior to Previous Quarter'),
+      'previous_before.month' => ts('Prior to Previous Month'),
+      'previous_before.week' => ts('Prior to Previous Week'),
+      'previous_before.day' => ts('Prior to Previous Day'),
+      'previous.year' => ts('Previous Year'),
+      'previous.fiscal_year' => ts('Previous Fiscal Year'),
+      'previous.quarter' => ts('Previous Quarter'),
+      'previous.month' => ts('Previous Month'),
+      'previous.week' => ts('Previous Week'),
+      'earlier.year' => ts('To End of Previous Year'),
+      'earlier.quarter' => ts('To End of Previous Quarter'),
+      'earlier.month' => ts('To End of Previous Month'),
+      'earlier.week' => ts('To End of Previous Week'),
+      'earlier.day' => ts('To End of Previous Day'),
+      'greater_previous.year' => ts('From End of Previous Year'),
+      'greater_previous.quarter' => ts('From End of Previous Quarter'),
+      'greater_previous.month' => ts('From End of Previous Month'),
+      'greater_previous.week' => ts('From End of Previous Week'),
+      'greater.year' => ts('From Start of Current Year'),
+      'greater.quarter' => ts('From Start of Current Quarter'),
+      'greater.month' => ts('From Start of Current Month'),
+      'greater.week' => ts('From Start of Current Week'),
+      'greater.day' => ts('From Start of Current Day'),
+      'current.year' => ts('Current Year to-date'),
+      'current.quarter' => ts('Current Quarter to-date'),
+      'current.month' => ts('Current Month to-date'),
+      'current.week' => ts('Current Week to-date'),
+      'ending_3.year' => ts('Last 3 Years'),
+      'ending_2.year' => ts('Last 2 Years'),
+      'ending.year' => ts('Last 12 Months'),
+      'ending.quarter' => ts('Last 3 Months'),
+      'ending.month' => ts('Last Month'),
+      'ending.week' => ts('Last 7 days'),
+      'previous.day' => ts('Yesterday'),
+      'this.year' => ts('This Year'),
+      'this.fiscal_year' => ts('This Fiscal Year'),
+      'this.quarter' => ts('This Quarter'),
+      'this.month' => ts('This Month'),
+      'this.week' => ts('This Week'),
+      'this.day' => ts('Today'),
+      'starting.day' => ts('Tomorrow'),
+      'starting.week' => ts('Upcoming 7 days'),
+      'starting.month' => ts('Upcoming Month'),
+      'starting.year' => ts('Upcoming 12 Months'),
+      'less.year' => ts('To End of Current Year'),
+      'less.quarter' => ts('To End of Current Quarter'),
+      'less.month' => ts('To End of Current Month'),
+      'less.week' => ts('To End of Current Week'),
+      'next.week' => ts('Next Week'),
+      'next.month' => ts('Next Month'),
+      'next.quarter' => ts('Next Quarter'),
+      'next.fiscal_year' => ts('Next Fiscal Year'),
+      'next.year' => ts('Next Year'),
+    );
 
     if (is_array($operators)) {
       $selector = array_merge($selector, $operators);
@@ -229,8 +225,6 @@ class CRM_Core_Form_Date {
    * @param bool $required
    * @param string $dateFormat
    * @param bool $displayTime
-   *
-   * @return null
    */
   public static function addDateRangeToForm(&$form, $fieldName, $selector, $from = '_from', $to = '_to', $fromLabel = 'From:', $required = FALSE, $dateFormat = 'searchDate', $displayTime = FALSE) {
     $form->add('select',
index e8627b24184a90b50e9ef4109d1023bab2c76a17..4c90973c5c3a55013e89fcf87b297072382850ed 100644 (file)
@@ -60,10 +60,10 @@ class CRM_Core_OptionValue {
    *
    * @param array $groupParams
    *   Array containing group fields whose option-values is to retrieved.
-   * @param string $orderBy
-   *   For orderBy clause.
    * @param array $links
    *   Has links like edit, delete, disable ..etc.
+   * @param string $orderBy
+   *   For orderBy clause.
    *
    * @return array
    *   Array of option-values
@@ -176,7 +176,7 @@ class CRM_Core_OptionValue {
    * @param array $groupParams
    *   Array containing group fields whose option-values is to retrieved/saved.
    * @param $action
-   * @param int $optionValueIDHas the id of the optionValue being edited, disabled ..etc.
+   * @param int $optionValueID Has the id of the optionValue being edited, disabled ..etc.
    *   Has the id of the optionValue being edited, disabled ..etc.
    *
    * @return CRM_Core_DAO_OptionValue
@@ -250,7 +250,7 @@ class CRM_Core_OptionValue {
    * @param string $fieldName
    *   The name of the field in the DAO.
    *
-   * @return boolean
+   * @return bool
    *   true if object exists
    */
   public static function optionExists($value, $daoName, $daoID, $optionGroupID, $fieldName = 'name') {
@@ -272,7 +272,7 @@ class CRM_Core_OptionValue {
    * @param string $mode
    * @param string $contactType
    *
-   * @return boolean
+   * @return bool
    *   true if object exists
    */
   public static function getFields($mode = '', $contactType = 'Individual') {
@@ -303,7 +303,7 @@ class CRM_Core_OptionValue {
           'Individual',
           'Household',
           'Organization',
-          'All'
+          'All',
         ))) {
           $nameTitle = array(
             'addressee' => array(
@@ -381,8 +381,7 @@ class CRM_Core_OptionValue {
    * @param string $orderBy
    *   For orderBy clause.
    *
-   * @param bool $isActiveDo you want only active option values?.
-   *   Do you want only active option values?.
+   * @param bool $isActive Do you want only active option values?
    *
    * @return array
    *   Array of option-values
index 521cd824d9f21ac99e52c000cc6f03c40a1193ad..550db1a58600a5b4fe51baa66aa0bc3adc8b528c 100644 (file)
@@ -162,15 +162,15 @@ class CRM_Core_Page {
 
   /**
    * This function takes care of all the things common to all
-   * pages. This typically involves assigning the appropriate
-   * smarty variable :)
+   * pages. This typically involves assigning the appropriate smarty
+   * variable :)
    *
-   * @return string
+   * @return void|string
    *   The content generated by running this page
    */
   public function run() {
     if ($this->_embedded) {
-      return;
+      return NULL;
     }
 
     self::$_template->assign('mode', $this->_mode);
@@ -186,7 +186,7 @@ class CRM_Core_Page {
         CRM_Core_Smarty::PRINT_SNIPPET,
         CRM_Core_Smarty::PRINT_PDF,
         CRM_Core_Smarty::PRINT_NOFORM,
-        CRM_Core_Smarty::PRINT_JSON
+        CRM_Core_Smarty::PRINT_JSON,
       ))) {
         $content = self::$_template->fetch('CRM/common/snippet.tpl');
       }
@@ -242,7 +242,6 @@ class CRM_Core_Page {
     CRM_Utils_Hook::alterContent($content, 'page', $pageTemplateFile, $this);
 
     echo CRM_Utils_System::theme($content, $this->_print);
-    return;
   }
 
   /**
@@ -262,8 +261,7 @@ class CRM_Core_Page {
   /**
    * Get the variable from the form scope
    *
-   * @param string name : name of the variable
-   *
+   * @param string $name name of the variable
    *
    * @return mixed
    */
@@ -376,7 +374,7 @@ class CRM_Core_Page {
   /**
    * Getter for embedded
    *
-   * @return boolean
+   * @return bool
    *   return the embedded value
    */
   public function getEmbedded() {
@@ -397,7 +395,7 @@ class CRM_Core_Page {
   /**
    * Getter for print
    *
-   * @return boolean
+   * @return bool
    *   return the print value
    */
   public function getPrint() {
index 635adf86299b9c92a8f4b1e09ed02b9cd9be5a8b..393e462d0759b3af7e93a234ca6fbac39d295006 100644 (file)
@@ -226,7 +226,7 @@ class CRM_Core_Payment_PayPalIPN extends CRM_Core_Payment_BaseIPN {
    * @param bool $recur
    * @param bool $first
    */
-  function single(
+  public function single(
     &$input, &$ids, &$objects,
     $recur = FALSE,
     $first = FALSE
index 7a5665f4525aabf039b2e8babd31a120071f8816..b9f0c677824bcb40b240a212f07675afec834719 100644 (file)
@@ -208,7 +208,7 @@ class CRM_Core_PseudoConstant {
    * - fresh      boolean ignore cache entries and go back to DB
    * @param string $context : Context string
    *
-   * @return Array|bool
+   * @return array|bool
    *   array on success, FALSE on error.
    *
    */
@@ -261,7 +261,7 @@ class CRM_Core_PseudoConstant {
     }
 
     // Core field: load schema
-    $dao = new $daoName;
+    $dao = new $daoName();
     $fieldSpec = $dao->getFieldSpec($fieldName);
     $dao->free();
     // If neither worked then this field doesn't exist. Return false.
@@ -323,7 +323,7 @@ class CRM_Core_PseudoConstant {
             return FALSE;
           }
           // Get list of fields for the option table
-          $dao = new $daoName;
+          $dao = new $daoName();
           $availableFields = array_keys($dao->fieldKeys());
           $dao->free();
 
@@ -467,7 +467,7 @@ class CRM_Core_PseudoConstant {
    * @param string $fieldName
    * @param string|Int $value
    *
-   * @return bool|null|string|number
+   * @return bool|null|string|int
    *   FALSE if the given field has no associated option list
    *   NULL if the given key has no corresponding option
    *   String|Number if key is found
@@ -553,7 +553,7 @@ class CRM_Core_PseudoConstant {
       return $var;
     }
 
-    $object = new $name ();
+    $object = new $name();
 
     $object->selectAdd();
     $object->selectAdd("$key, $retrieve");
@@ -1735,7 +1735,7 @@ WHERE  id = %1
       $defaultGreetings = array();
       $contactTypes = self::get('CRM_Contact_DAO_Contact', 'contact_type', array(
           'keyColumn' => 'id',
-          'labelColumn' => 'name'
+          'labelColumn' => 'name',
         ));
 
       foreach ($contactTypes as $filter => $contactType) {
index dd0f937618b258d48728771d55358a96102351e4..872c00a72827cd13a9cd3cecda8e43a5fe6679b3 100644 (file)
@@ -1,28 +1,28 @@
 <?php
 /*
- +--------------------------------------------------------------------+
- | CiviCRM version 4.6                                                |
- +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014                                |
- +--------------------------------------------------------------------+
- | This file is a part of CiviCRM.                                    |
- |                                                                    |
- | CiviCRM is free software; you can copy, modify, and distribute it  |
- | under the terms of the GNU Affero General Public License           |
- | Version 3, 19 November 2007 and the CiviCRM Licensing Exception.   |
- |                                                                    |
- | CiviCRM is distributed in the hope that it will be useful, but     |
- | WITHOUT ANY WARRANTY; without even the implied warranty of         |
- | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.               |
- | See the GNU Affero General Public License for more details.        |
- |                                                                    |
- | You should have received a copy of the GNU Affero General Public   |
- | License and the CiviCRM Licensing Exception along                  |
- | with this program; if not, contact CiviCRM LLC                     |
- | at info[AT]civicrm[DOT]org. If you have questions about the        |
- | GNU Affero General Public License or the licensing of CiviCRM,     |
- | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
- +--------------------------------------------------------------------+
 +--------------------------------------------------------------------+
 | CiviCRM version 4.6                                                |
 +--------------------------------------------------------------------+
 | Copyright CiviCRM LLC (c) 2004-2014                                |
 +--------------------------------------------------------------------+
 | This file is a part of CiviCRM.                                    |
 |                                                                    |
 | CiviCRM is free software; you can copy, modify, and distribute it  |
 | under the terms of the GNU Affero General Public License           |
 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception.   |
 |                                                                    |
 | CiviCRM is distributed in the hope that it will be useful, but     |
 | WITHOUT ANY WARRANTY; without even the implied warranty of         |
 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.               |
 | See the GNU Affero General Public License for more details.        |
 |                                                                    |
 | You should have received a copy of the GNU Affero General Public   |
 | License and the CiviCRM Licensing Exception along                  |
 | with this program; if not, contact CiviCRM LLC                     |
 | at info[AT]civicrm[DOT]org. If you have questions about the        |
 | GNU Affero General Public License or the licensing of CiviCRM,     |
 | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
 +--------------------------------------------------------------------+
 */
 
 /**
@@ -112,9 +112,9 @@ class CRM_Core_Resources {
     if (self::$_singleton === NULL) {
       $sys = CRM_Extension_System::singleton();
       $cache = new CRM_Utils_Cache_SqlGroup(array(
-        'group' => 'js-strings',
-        'prefetch' => FALSE,
-      ));
+                 'group' => 'js-strings',
+                 'prefetch' => FALSE,
+               ));
       self::$_singleton = new CRM_Core_Resources(
         $sys->getMapper(),
         $cache,
@@ -189,12 +189,12 @@ class CRM_Core_Resources {
    */
   public function addScriptUrl($url, $weight = self::DEFAULT_WEIGHT, $region = self::DEFAULT_REGION) {
     CRM_Core_Region::instance($region)->add(array(
-      'name' => $url,
-      'type' => 'scriptUrl',
-      'scriptUrl' => $url,
-      'weight' => $weight,
-      'region' => $region,
-    ));
+        'name' => $url,
+        'type' => 'scriptUrl',
+        'scriptUrl' => $url,
+        'weight' => $weight,
+        'region' => $region,
+      ));
     return $this;
   }
 
@@ -211,12 +211,12 @@ class CRM_Core_Resources {
    */
   public function addScript($code, $weight = self::DEFAULT_WEIGHT, $region = self::DEFAULT_REGION) {
     CRM_Core_Region::instance($region)->add(array(
-      // 'name' => automatic
-      'type' => 'script',
-      'script' => $code,
-      'weight' => $weight,
-      'region' => $region,
-    ));
+        // 'name' => automatic
+        'type' => 'script',
+        'script' => $code,
+        'weight' => $weight,
+        'region' => $region,
+      ));
     return $this;
   }
 
@@ -395,12 +395,12 @@ class CRM_Core_Resources {
    */
   public function addStyleUrl($url, $weight = self::DEFAULT_WEIGHT, $region = self::DEFAULT_REGION) {
     CRM_Core_Region::instance($region)->add(array(
-      'name' => $url,
-      'type' => 'styleUrl',
-      'styleUrl' => $url,
-      'weight' => $weight,
-      'region' => $region,
-    ));
+        'name' => $url,
+        'type' => 'styleUrl',
+        'styleUrl' => $url,
+        'weight' => $weight,
+        'region' => $region,
+      ));
     return $this;
   }
 
@@ -417,12 +417,12 @@ class CRM_Core_Resources {
    */
   public function addStyle($code, $weight = self::DEFAULT_WEIGHT, $region = self::DEFAULT_REGION) {
     CRM_Core_Region::instance($region)->add(array(
-      // 'name' => automatic
-      'type' => 'style',
-      'style' => $code,
-      'weight' => $weight,
-      'region' => $region,
-    ));
+        // 'name' => automatic
+        'type' => 'style',
+        'style' => $code,
+        'weight' => $weight,
+        'region' => $region,
+      ));
     return $this;
   }
 
@@ -533,7 +533,7 @@ class CRM_Core_Resources {
         'config' => array(
           'ajaxPopupsEnabled' => $this->ajaxPopupsEnabled,
           'isFrontend' => $config->userFrameworkFrontend,
-        )
+        ),
       );
       // Disable profile creation if user lacks permission
       if (!CRM_Core_Permission::check('edit all contacts') && !CRM_Core_Permission::check('add contacts')) {
@@ -613,10 +613,7 @@ class CRM_Core_Resources {
   }
 
   /**
-   * Create dynamic script for localizing js widgets
-   *
-   * @return string
-   *   javascript content
+   * Create dynamic script for localizing js widgets.
    */
   public static function outputLocalizationJS() {
     CRM_Core_Page_AJAX::setJsHeaders();
@@ -715,7 +712,7 @@ class CRM_Core_Resources {
     return in_array(CRM_Utils_Array::value('snippet', $_REQUEST), array(
         CRM_Core_Smarty::PRINT_SNIPPET,
         CRM_Core_Smarty::PRINT_NOFORM,
-        CRM_Core_Smarty::PRINT_JSON
+        CRM_Core_Smarty::PRINT_JSON,
       ));
   }
 
@@ -738,7 +735,7 @@ class CRM_Core_Resources {
           array('key' => '{"BETWEEN":["now - 3 month","now"]}', 'value' => ts('Past 3 Months')),
           array('key' => '{"BETWEEN":["now - 6 month","now"]}', 'value' => ts('Past 6 Months')),
           array('key' => '{"BETWEEN":["now - 1 year","now"]}', 'value' => ts('Past Year')),
-        )
+        ),
       ),
     );
 
index e1ded4f394ff232356121251d73ba6f8727d89ad..30de49c4becc180974dc9f12fd850a91be3b48f9 100644 (file)
@@ -62,8 +62,6 @@ class CRM_Custom_Page_Field extends CRM_Core_Page {
   /**
    * Get the action links for this page.
    *
-   * @param null
-   *
    * @return array
    *   array of action links that we need to display for the browse screen
    */
@@ -119,8 +117,6 @@ class CRM_Custom_Page_Field extends CRM_Core_Page {
   /**
    * Browse all custom group fields.
    *
-   * @param null
-   *
    * @return void
    */
   public function browse() {
@@ -226,8 +222,6 @@ class CRM_Custom_Page_Field extends CRM_Core_Page {
    * This method is called after the page is created. It checks for the
    * type of action and executes that action.
    *
-   * @param null
-   *
    * @return void
    */
   public function run() {
index c33ba68b8a3aeea8f9b5cec89832b73c66efe0bb..a95d8f1daef8a24b82404c4e329c809a0928d4a2 100644 (file)
@@ -74,7 +74,7 @@ abstract class CRM_Event_Import_Parser extends CRM_Import_Parser {
    * @return mixed
    * @throws Exception
    */
-  function run(
+  public function run(
     $fileName,
     $seperator = ',',
     &$mapper,
@@ -293,7 +293,7 @@ abstract class CRM_Event_Import_Parser extends CRM_Import_Parser {
    * Given a list of the importable field keys that the user has selected
    * set the active fields array to this list
    *
-   * @param array mapped array of values
+   * @param $fieldKeys array mapped array of values
    *
    * @return void
    */
index ead0bcf0ae2ae6902795da9d6c56ab48045a4220..3ad68f4d1b1716ef7b0958824dc760f0aa2436bd 100644 (file)
@@ -195,7 +195,7 @@ class CRM_Event_Page_EventInfo extends CRM_Core_Page {
       $this->assign('mapKey', $config->mapAPIKey);
       $sumLat = $sumLng = 0;
       $maxLat = $maxLng = -400;
-      $minLat = $minLng = +400;
+      $minLat = $minLng = 400;
       foreach ($locations as $location) {
         $sumLat += $location['lat'];
         $sumLng += $location['lng'];
index 17d52e685fbc1bb4cce91cb49881668fd5e2e257..b82f525276765ab589e78eb3b5504b50c01fb582 100644 (file)
@@ -75,12 +75,10 @@ class CRM_Grant_Form_Search extends CRM_Core_Form_Search {
    *
    * @return void
    */
-  function preProcess() {
-
+  public function preProcess() {
     /**
      * set the button names
      */
-
     $this->_searchButtonName = $this->getButtonName('refresh');
     $this->_actionButtonName = $this->getButtonName('next', 'action');
 
index 5cde2ff911855377b18b769c28390b322e132089..86cd3d2fc57d4370dd7c4702ba115218b7431790 100644 (file)
@@ -391,7 +391,7 @@ SELECT     civicrm_email.id as email_id
         $group[$groupID]['status'] = $contactGroups[$groupID]['status'];
         $status = ts('You are already subscribed in %1, your subscription is %2.', array(
             1 => $group[$groupID]['title'],
-            2 => $group[$groupID]['status']
+            2 => $group[$groupID]['status'],
           ));
         CRM_Utils_System::setUFMessage($status);
         continue;
index 83c285b007ff3c0a87873e854f3f00299d2fc633..b24531f1539e0dedf5bd60cbabe6db9639a3cdda 100644 (file)
@@ -121,9 +121,9 @@ class CRM_SMS_Form_Schedule extends CRM_Core_Form {
    * @param $files
    * @param $self
    *
-   * @return boolean
-   *   True if either we deliver immediately, or the
-   *                          date is properly set.
+   * @return bool
+   *   True if either we deliver immediately, or the date is properly
+   *   set.
    */
   public static function formRule($params, $files, $self) {
     if (!empty($params['_qf_Schedule_submit'])) {
index d34ee9876f866ba76fe0986080567f91fa343546..7ec295c8fc05e8043a4c245b684b326d8b0e4fd1 100644 (file)
@@ -989,7 +989,7 @@ function _civicrm_api3_deprecated_add_formatted_location_blocks(&$values, &$para
              'Email',
              'IM',
              'OpenID',
-             'Phone_Ext'
+             'Phone_Ext',
            ) as $block) {
     $name = strtolower($block);
     if (!array_key_exists($name, $values)) {
index 261da7350bad287fb95b73b3d4fcfeaa020a9c9f..a8ef8b0da8b3bc77851ad672d8023ec829e58333 100644 (file)
@@ -17,7 +17,7 @@ class CRM_Case_AllTests extends CiviTestSuite {
    */
   private static function getInstance() {
     if (is_null(self::$instance)) {
-      self::$instance = new self;
+      self::$instance = new self();
     }
     return self::$instance;
   }
index 1c36c0a722f1c17ce13582445790bbf050e48015..189c7b21fb084f18cb617c49cf3994707e45594b 100644 (file)
@@ -37,7 +37,7 @@ class CRM_Core_BAO_CustomValueTableTest extends CiviUnitTestCase {
         'table_name' => 'civicrm_value_test_group_' . $customGroup->id,
         'column_name' => 'test_Country_' . $customField->id,
         'file_id' => '',
-      )
+      ),
     );
 
     CRM_Core_BAO_CustomValueTable::store($params, 'civicrm_contact', $contactID);
@@ -72,7 +72,7 @@ class CRM_Core_BAO_CustomValueTableTest extends CiviUnitTestCase {
         'table_name' => 'civicrm_value_test_group_' . $customGroup->id,
         'column_name' => 'test_File_' . $customField->id,
         'file_id' => 1,
-      )
+      ),
     );
 
     CRM_Core_BAO_CustomValueTable::store($params, 'civicrm_contact', $contactID);
@@ -107,7 +107,7 @@ class CRM_Core_BAO_CustomValueTableTest extends CiviUnitTestCase {
         'table_name' => 'civicrm_value_test_group_' . $customGroup->id,
         'column_name' => 'test_StateProvince_' . $customField->id,
         'file_id' => 1,
-      )
+      ),
     );
 
     CRM_Core_BAO_CustomValueTable::store($params, 'civicrm_contact', $contactID);
@@ -141,7 +141,7 @@ class CRM_Core_BAO_CustomValueTableTest extends CiviUnitTestCase {
         'table_name' => 'civicrm_value_test_group_' . $customGroup->id,
         'column_name' => 'test_Date_' . $customField->id,
         'file_id' => '',
-      )
+      ),
     );
 
     CRM_Core_BAO_CustomValueTable::store($params, 'civicrm_contact', $contactID);
@@ -176,7 +176,7 @@ class CRM_Core_BAO_CustomValueTableTest extends CiviUnitTestCase {
         'table_name' => 'civicrm_value_test_group_' . $customGroup->id,
         'column_name' => 'test_Memo_' . $customField->id,
         'file_id' => '',
-      )
+      ),
     );
 
     CRM_Core_BAO_CustomValueTable::store($params, 'civicrm_contact', $contactID);
@@ -212,7 +212,7 @@ class CRM_Core_BAO_CustomValueTableTest extends CiviUnitTestCase {
         'table_name' => 'civicrm_value_test_group_' . $customGroup->id,
         'column_name' => 'test_Memo_' . $customField->id,
         'file_id' => '',
-      )
+      ),
     );
 
     CRM_Core_BAO_CustomValueTable::store($params, 'civicrm_contact', $contactID);
index 3f25895f60d0ce6577b151d583aef854b0f0a510..7afef4790655c6b1f1ac71855518b4eea039a87b 100644 (file)
@@ -79,15 +79,15 @@ class WebTest_Admin_MoveCustomDataTest extends CiviSeleniumTestCase {
     $post_move_values[$cid_to_missing]['source'] = $this->_loadDataFromApi($cid_to_missing, $from_group_id);
     $post_move_values[$cid_to_missing]['destination'] = $this->_loadDataFromApi($cid_to_missing, $to_group_id);
 
-    //Make sure that only the appropriate values have changed
+    // Make sure that only the appropriate values have changed.
     foreach (array(
                $cid_all,
                $cid_from_missing,
-               $cid_to_missing
+               $cid_to_missing,
              ) as $cid) {
       foreach (array(
                  'source',
-                 'destination'
+                 'destination',
                ) as $fieldset) {
         foreach ($pre_move_values[$cid][$fieldset] as $id => $value) {
           if ($id != $field_to_move) {
@@ -280,7 +280,7 @@ class WebTest_Admin_MoveCustomDataTest extends CiviSeleniumTestCase {
           'option_07',
           'option_08',
           'option_09',
-          'option_10'
+          'option_10',
         ),
       ),
       'integer' => array(
@@ -403,7 +403,7 @@ class WebTest_Admin_MoveCustomDataTest extends CiviSeleniumTestCase {
     //get the custom id of the custom field that was just created
     $results = $this->webtest_civicrm_api("CustomField", "get", array(
         'label' => $fieldLabel,
-        'custom_group_id' => $group_id
+        'custom_group_id' => $group_id,
       ));
     //While there _technically_ could be two fields with the same name, its highly unlikely
     //so assert that exactly one result is return
@@ -417,7 +417,7 @@ class WebTest_Admin_MoveCustomDataTest extends CiviSeleniumTestCase {
    * @param string $prefix
    * @param array $values
    */
-  function _createFieldOptions($count = 3, $prefix = "option", $values = array()) {
+  public function _createFieldOptions($count = 3, $prefix = "option", $values = array()) {
     // Only support up to 10 options on the creation form
     $count = $count > 10 ? 10 : $count;
 
@@ -450,7 +450,7 @@ class WebTest_Admin_MoveCustomDataTest extends CiviSeleniumTestCase {
     $field_ids = array_keys($fields);
     $contact = $this->webtest_civicrm_api("Contact", "get", array(
         'contact_id' => $contact_id,
-        'return.custom_' . $field_ids[0] => 1
+        'return.custom_' . $field_ids[0] => 1,
       ));
     $group = $this->webtest_civicrm_api("CustomGroup", "get", array('id' => $group_id, 'return.table_name' => 1));
 
index 815c946134fd4bb69573cb813f171b50ff4f4277..5feeff38191b625407b23e1d7166c7afdcbbe452 100644 (file)
@@ -37,8 +37,11 @@ class WebTest_Contact_CreateCmsUserFromContactTest extends CiviSeleniumTestCase
     parent::setUp();
   }
 
-  //Test that option to create a cms user is present on a contact who does not
-  //have a cms account already( in this case, a new contact )
+  /**
+   * Test that option to create a cms user is present on a contact who
+   * does not have a cms account already (in this case, a new
+   * contact).
+   */
   public function testCreateContactLinkPresent() {
 
     //login
@@ -56,8 +59,10 @@ class WebTest_Contact_CreateCmsUserFromContactTest extends CiviSeleniumTestCase
     $this->assertElementContainsText("css=#actions li.crm-contact-user-record", "Create User Record", "Create User Record link not in action menu of new contact");
   }
 
-  //Test that the action link is missing for users who already have a contact
-  //record. The contact record for drupal user 1 is used
+  /**
+   * Test that the action link is missing for users who already have a
+   * contact record. The contact record for drupal user 1 is used.
+   */
   public function testCreateContactLinkMissing() {
 
     //login
@@ -78,7 +83,9 @@ class WebTest_Contact_CreateCmsUserFromContactTest extends CiviSeleniumTestCase
     $this->assertElementNotContainsText("css=#actions li.crm-contact-user-record", "Create User Record", "Create User Record link not in action menu of new contact");
   }
 
-  //Test the ajax "check username availibity" link when adding cms user
+  /**
+   * Test the ajax "check username availibity" link when adding cms user.
+   */
   public function testCheckUsernameAvailability() {
     $this->webtestLogin('admin');
 
@@ -101,7 +108,9 @@ class WebTest_Contact_CreateCmsUserFromContactTest extends CiviSeleniumTestCase
     $this->assertElementContainsText("msgbox", "This username is currently available", "Available username is indicated as being taken");
   }
 
-  //Test form submission when the username is taken
+  /**
+   * Test form submission when the username is taken.
+   */
   public function testTakenUsernameSubmission() {
 
     //login
@@ -125,7 +134,9 @@ class WebTest_Contact_CreateCmsUserFromContactTest extends CiviSeleniumTestCase
     $this->assertTrue($results['count'] == 0);
   }
 
-  //Test form sumbission when user passwords dont match
+  /**
+   * Test form sumbission when user passwords dont match.
+   */
   public function testMismatchPasswordSubmission() {
 
     //login
@@ -177,7 +188,9 @@ class WebTest_Contact_CreateCmsUserFromContactTest extends CiviSeleniumTestCase
     $this->assertTrue($results['count'] == 0);
   }
 
-  //Test a valid (username unique and passwords match) submission
+  /**
+   * Test a valid (username unique and passwords match) submission.
+   */
   public function testValidSubmission() {
 
     //login
index 81bc18ca2f281009b7a8342c2b28ffc045aa2382..0880354d2480bb08f147108d68142ac50c81b00e 100644 (file)
@@ -359,19 +359,25 @@ class WebTest_Event_AddParticipationTest extends CiviSeleniumTestCase {
       array(
         'entity' => 'ParticipantEventName',
         'subEntity' => 'Fall Fundraiser Dinner',
-        'triggerElement' => array('name' => "event_id", 'type' => "select2")
+        'triggerElement' => array(
+          'name' => "event_id",
+          'type' => "select2",
+        ),
       ),
       array(
         'entity' => 'ParticipantRole',
         'subEntity' => 'Attendee',
-        'triggerElement' => array('name' => 'role_id', 'type' => "select")
+        'triggerElement' => array(
+          'name' => 'role_id',
+          'type' => "select",
+        ),
       ),
     );
     $pageUrl = array('url' => "participant/add", 'args' => "reset=1&action=add&context=standalone");
     $this->customFieldSetLoadOnTheFlyCheck($customSets, $pageUrl, TRUE);
   }
 
-  /*
+  /**
    * Webtest for CRM-10983
    */
   public function testCheckDuplicateCustomDataLoad() {
@@ -381,20 +387,41 @@ class WebTest_Event_AddParticipationTest extends CiviSeleniumTestCase {
       array(
         'entity' => 'ParticipantEventType',
         'subEntity' => '- Any -',
-        'triggerElement' => array('name' => "event_id", 'type' => "select")
+        'triggerElement' => array(
+          'name' => "event_id",
+          'type' => "select",
+        ),
       ),
       array(
         'entity' => 'ParticipantEventName',
         'subEntity' => '- Any -',
-        'triggerElement' => array('name' => "event_id", 'type' => "select")
+        'triggerElement' => array(
+          'name' => "event_id",
+          'type' => "select",
+        ),
       ),
       array(
         'entity' => 'ParticipantEventName',
         'subEntity' => 'Rain-forest Cup Youth Soccer Tournament',
-        'triggerElement' => array('name' => "event_id", 'type' => "select")
+        'triggerElement' => array(
+          'name' => "event_id",
+          'type' => "select",
+        ),
+      ),
+      array(
+        'entity' => 'ParticipantRole',
+        'subEntity' => '- Any -',
+        'triggerElement' => array(
+          'type' => "checkbox",
+        ),
+      ),
+      array(
+        'entity' => 'ParticipantRole',
+        'subEntity' => 'Volunteer',
+        'triggerElement' => array(
+          'type' => "checkbox",
+        ),
       ),
-      array('entity' => 'ParticipantRole', 'subEntity' => '- Any -', 'triggerElement' => array('type' => "checkbox")),
-      array('entity' => 'ParticipantRole', 'subEntity' => 'Volunteer', 'triggerElement' => array('type' => "checkbox")),
     );
 
     $return = $this->addCustomGroupField($customSets);
index 75f6b0e3b45756c1c680e8cca433630c56eba371..73eb16c1d49f9087ba97fac837ea024e2178c4b6 100644 (file)
@@ -35,7 +35,7 @@ class WebTest_Import_DateFormatTest extends ImportCiviSeleniumTestCase {
     parent::setUp();
   }
 
-  /*
+  /**
    *  Test contact import for yyyy_mm_dd date format.
    */
   public function testDateFormat_yyyy_mm_dd() {
@@ -50,7 +50,7 @@ class WebTest_Import_DateFormatTest extends ImportCiviSeleniumTestCase {
     $this->importContacts($headers, $rows, 'Individual', 'Skip', array(), $other);
   }
 
-  /*
+  /**
    *  Test contact import for mm_dd_yy date format.
    */
   public function testDateFormat_mm_dd_yy() {
@@ -66,7 +66,7 @@ class WebTest_Import_DateFormatTest extends ImportCiviSeleniumTestCase {
     $this->importContacts($headers, $rows, 'Individual', 'Skip', array(), $other);
   }
 
-  /*
+  /**
    *  Test contact import for mm_dd_yyyy date format.
    */
   public function testDateFormat_mm_dd_yyyy() {
@@ -87,7 +87,7 @@ class WebTest_Import_DateFormatTest extends ImportCiviSeleniumTestCase {
     $this->importContacts($headers, $rows, 'Individual', 'Skip', array(), $other);
   }
 
-  /*
+  /**
    *  Test contact import for Month_dd_yyyy date format.
    */
   public function testDateFormat_Month_dd_yyyy() {
@@ -108,7 +108,7 @@ class WebTest_Import_DateFormatTest extends ImportCiviSeleniumTestCase {
     $this->importContacts($headers, $rows, 'Individual', 'Skip', array(), $other);
   }
 
-  /*
+  /**
    *  Test contact import for dd_mon_yy date format.
    */
   public function testDateFormat_dd_mon_yy() {
@@ -129,7 +129,7 @@ class WebTest_Import_DateFormatTest extends ImportCiviSeleniumTestCase {
     $this->importContacts($headers, $rows, 'Individual', 'Skip', array(), $other);
   }
 
-  /*
+  /**
    *  Test contact import for dd_mm_yyyy date format.
    */
   public function testDateFormat_dd_mm_yyyy() {
@@ -150,7 +150,7 @@ class WebTest_Import_DateFormatTest extends ImportCiviSeleniumTestCase {
     $this->importContacts($headers, $rows, 'Individual', 'Skip', array(), $other);
   }
 
-  /*
+  /**
    *  Helper function to provide data for contact import for Individuals and yyyy-mm-dd OR yyyymmdd dateformat.
    */
   /**
@@ -203,7 +203,7 @@ class WebTest_Import_DateFormatTest extends ImportCiviSeleniumTestCase {
     return array($headers, $rows);
   }
 
-  /*
+  /**
    *  Helper function to provide data for contact import for Individuals and mm/dd/yy OR mm-dd-yy dateformat.
    */
   /**
@@ -256,7 +256,7 @@ class WebTest_Import_DateFormatTest extends ImportCiviSeleniumTestCase {
     return array($headers, $rows);
   }
 
-  /*
+  /**
    *  Helper function to provide data for contact import for Individuals and mm/dd/yyyy OR mm-dd-yyyy dateformat.
    */
   /**
@@ -309,7 +309,7 @@ class WebTest_Import_DateFormatTest extends ImportCiviSeleniumTestCase {
     return array($headers, $rows);
   }
 
-  /*
+  /**
    *  Helper function to provide data for contact import for Individuals and Month dd, yyyy dateformat.
    */
   /**
@@ -362,7 +362,7 @@ class WebTest_Import_DateFormatTest extends ImportCiviSeleniumTestCase {
     return array($headers, $rows);
   }
 
-  /*
+  /**
    *  Helper function to provide data for contact import for Individuals and dd-mon-yy OR dd/mm/yy dateformat.
    */
   /**
@@ -415,7 +415,7 @@ class WebTest_Import_DateFormatTest extends ImportCiviSeleniumTestCase {
     return array($headers, $rows);
   }
 
-  /*
+  /**
    *  Helper function to provide data for contact import for Individuals and dd/mm/yyyy dateformat.
    */
   /**
index 8963724df0424663a818d00034eae58a890f6024..7fb663542a05d52f381c1a4151720d06f6afebeb 100644 (file)
@@ -1,27 +1,27 @@
 <?php
 /*
- +--------------------------------------------------------------------+
- | CiviCRM version 4.6                                                |
- +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014                                |
- +--------------------------------------------------------------------+
- | This file is a part of CiviCRM.                                    |
- |                                                                    |
- | CiviCRM is free software; you can copy, modify, and distribute it  |
- | under the terms of the GNU Affero General Public License           |
- | Version 3, 19 November 2007 and the CiviCRM Licensing Exception.   |
- |                                                                    |
- | CiviCRM is distributed in the hope that it will be useful, but     |
- | WITHOUT ANY WARRANTY; without even the implied warranty of         |
- | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.               |
- | See the GNU Affero General Public License for more details.        |
- |                                                                    |
- | You should have received a copy of the GNU Affero General Public   |
- | License along with this program; if not, contact CiviCRM LLC       |
- | at info[AT]civicrm[DOT]org. If you have questions about the        |
- | GNU Affero General Public License or the licensing of CiviCRM,     |
- | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
- +--------------------------------------------------------------------+
 +--------------------------------------------------------------------+
 | CiviCRM version 4.6                                                |
 +--------------------------------------------------------------------+
 | Copyright CiviCRM LLC (c) 2004-2014                                |
 +--------------------------------------------------------------------+
 | This file is a part of CiviCRM.                                    |
 |                                                                    |
 | CiviCRM is free software; you can copy, modify, and distribute it  |
 | under the terms of the GNU Affero General Public License           |
 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception.   |
 |                                                                    |
 | CiviCRM is distributed in the hope that it will be useful, but     |
 | WITHOUT ANY WARRANTY; without even the implied warranty of         |
 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.               |
 | See the GNU Affero General Public License for more details.        |
 |                                                                    |
 | You should have received a copy of the GNU Affero General Public   |
 | License along with this program; if not, contact CiviCRM LLC       |
 | at info[AT]civicrm[DOT]org. If you have questions about the        |
 | GNU Affero General Public License or the licensing of CiviCRM,     |
 | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
 +--------------------------------------------------------------------+
 */
 
 require_once 'WebTest/Import/ImportCiviSeleniumTestCase.php';
@@ -68,33 +68,33 @@ class WebTest_Import_MultipleRelationshipTest extends ImportCiviSeleniumTestCase
       'state' => 'State',
       'country' => 'Country',
       'contact_relationships' =>
-        array(
-          '4_a_b' => array(
-            'organization_name' => 'Organization Name',
-            'organization_email' => 'Organization Email',
-            'organization_add' => 'Organization Street Address',
-            'organization_city' => 'Organization City',
-            'organization_state' => 'Organization State',
-            'organization_country' => 'Organization Country',
-          ),
-          '7_a_b' => array(
-            'household_name' => 'Household Name',
-            'household_email' => 'Household Name',
-            'household_add' => 'Household Street Address',
-            'household_city' => 'Household City',
-            'household_state' => 'Household State',
-            'household_country' => 'Household Country',
-          ),
-          '2_a_b' => array(
-            'spouse_f_name' => 'Spouse First Name',
-            'spouse_l_name' => 'Spouse Last Name',
-            'spouse_email' => 'Spouse Email',
-            'spouse_add' => 'Spouse Street Address',
-            'spouse_city' => 'Spouse City',
-            'spouse_state' => 'Spouse State',
-            'spouse_country' => 'Spouse Country',
-          ),
+      array(
+        '4_a_b' => array(
+          'organization_name' => 'Organization Name',
+          'organization_email' => 'Organization Email',
+          'organization_add' => 'Organization Street Address',
+          'organization_city' => 'Organization City',
+          'organization_state' => 'Organization State',
+          'organization_country' => 'Organization Country',
+        ),
+        '7_a_b' => array(
+          'household_name' => 'Household Name',
+          'household_email' => 'Household Name',
+          'household_add' => 'Household Street Address',
+          'household_city' => 'Household City',
+          'household_state' => 'Household State',
+          'household_country' => 'Household Country',
+        ),
+        '2_a_b' => array(
+          'spouse_f_name' => 'Spouse First Name',
+          'spouse_l_name' => 'Spouse Last Name',
+          'spouse_email' => 'Spouse Email',
+          'spouse_add' => 'Spouse Street Address',
+          'spouse_city' => 'Spouse City',
+          'spouse_state' => 'Spouse State',
+          'spouse_country' => 'Spouse Country',
         ),
+      ),
     );
 
     $rows = array(
@@ -110,33 +110,33 @@ class WebTest_Import_MultipleRelationshipTest extends ImportCiviSeleniumTestCase
         'state' => 'NY',
         'country' => 'United States',
         'contact_relationships' =>
-          array(
-            '4_a_b' => array(
-              'organization_name' => 'Org ' . substr(sha1(rand()), 0, 7),
-              'organization_email' => substr(sha1(rand()), 0, 7) . 'org@example.org',
-              'organization_add' => 'Org Street Address',
-              'organization_city' => 'Org City',
-              'organization_state' => 'NY',
-              'organization_country' => 'United States',
-            ),
-            '7_a_b' => array(
-              'household_name' => 'House ' . substr(sha1(rand()), 0, 7),
-              'household_email' => substr(sha1(rand()), 0, 7) . 'house@example.org',
-              'household_add' => 'House Street Address',
-              'household_city' => 'House City',
-              'household_state' => 'NY',
-              'household_country' => 'United States',
-            ),
-            '2_a_b' => array(
-              'spouse_f_name' => substr(sha1(rand()), 0, 7),
-              'spouse_l_name' => substr(sha1(rand()), 0, 7),
-              'spouse_email' => substr(sha1(rand()), 0, 7) . 'spouse@example.org',
-              'spouse_add' => 'Spouse Street Address',
-              'spouse_city' => 'Spouse City',
-              'spouse_state' => 'NY',
-              'spouse_country' => 'United States',
-            ),
+        array(
+          '4_a_b' => array(
+            'organization_name' => 'Org ' . substr(sha1(rand()), 0, 7),
+            'organization_email' => substr(sha1(rand()), 0, 7) . 'org@example.org',
+            'organization_add' => 'Org Street Address',
+            'organization_city' => 'Org City',
+            'organization_state' => 'NY',
+            'organization_country' => 'United States',
           ),
+          '7_a_b' => array(
+            'household_name' => 'House ' . substr(sha1(rand()), 0, 7),
+            'household_email' => substr(sha1(rand()), 0, 7) . 'house@example.org',
+            'household_add' => 'House Street Address',
+            'household_city' => 'House City',
+            'household_state' => 'NY',
+            'household_country' => 'United States',
+          ),
+          '2_a_b' => array(
+            'spouse_f_name' => substr(sha1(rand()), 0, 7),
+            'spouse_l_name' => substr(sha1(rand()), 0, 7),
+            'spouse_email' => substr(sha1(rand()), 0, 7) . 'spouse@example.org',
+            'spouse_add' => 'Spouse Street Address',
+            'spouse_city' => 'Spouse City',
+            'spouse_state' => 'NY',
+            'spouse_country' => 'United States',
+          ),
+        ),
       ),
       array(
         'first_name' => substr(sha1(rand()), 0, 7),
@@ -150,33 +150,33 @@ class WebTest_Import_MultipleRelationshipTest extends ImportCiviSeleniumTestCase
         'state' => 'NY',
         'country' => 'United States',
         'contact_relationships' =>
-          array(
-            '4_a_b' => array(
-              'organization_name' => 'Org ' . substr(sha1(rand()), 0, 7),
-              'organization_email' => substr(sha1(rand()), 0, 7) . 'org@example.org',
-              'organization_add' => 'Org Street Address',
-              'organization_city' => 'Org City',
-              'organization_state' => 'NY',
-              'organization_country' => 'United States',
-            ),
-            '7_a_b' => array(
-              'household_name' => 'House ' . substr(sha1(rand()), 0, 7),
-              'household_email' => substr(sha1(rand()), 0, 7) . 'house@example.org',
-              'household_add' => 'House Street Address',
-              'household_city' => 'House City',
-              'household_state' => 'NY',
-              'household_country' => 'United States',
-            ),
-            '2_a_b' => array(
-              'spouse_f_name' => substr(sha1(rand()), 0, 7),
-              'spouse_l_name' => substr(sha1(rand()), 0, 7),
-              'spouse_email' => substr(sha1(rand()), 0, 7) . 'spouse@example.org',
-              'spouse_add' => 'Spouse Street Address',
-              'spouse_city' => 'Spouse City',
-              'spouse_state' => 'NY',
-              'spouse_country' => 'United States',
-            ),
+        array(
+          '4_a_b' => array(
+            'organization_name' => 'Org ' . substr(sha1(rand()), 0, 7),
+            'organization_email' => substr(sha1(rand()), 0, 7) . 'org@example.org',
+            'organization_add' => 'Org Street Address',
+            'organization_city' => 'Org City',
+            'organization_state' => 'NY',
+            'organization_country' => 'United States',
           ),
+          '7_a_b' => array(
+            'household_name' => 'House ' . substr(sha1(rand()), 0, 7),
+            'household_email' => substr(sha1(rand()), 0, 7) . 'house@example.org',
+            'household_add' => 'House Street Address',
+            'household_city' => 'House City',
+            'household_state' => 'NY',
+            'household_country' => 'United States',
+          ),
+          '2_a_b' => array(
+            'spouse_f_name' => substr(sha1(rand()), 0, 7),
+            'spouse_l_name' => substr(sha1(rand()), 0, 7),
+            'spouse_email' => substr(sha1(rand()), 0, 7) . 'spouse@example.org',
+            'spouse_add' => 'Spouse Street Address',
+            'spouse_city' => 'Spouse City',
+            'spouse_state' => 'NY',
+            'spouse_country' => 'United States',
+          ),
+        ),
       ),
     );
     // for Employee of relationship
index ab6344aa86d53b325c95dc89f1f9a6869de6d29b..ee35c8e0c4d2080a0dbd173fb1802300a28d653e 100644 (file)
@@ -62,7 +62,7 @@ class WebTest_Profile_ProfileCountryState extends CiviSeleniumTestCase {
     $this->openCiviPage('admin/uf/group/field/add', array(
         'action' => 'add',
         'reset' => 1,
-        'gid' => $gid
+        'gid' => $gid,
       ), 'field_name[0]');
     $this->click('field_name[0]');
     $this->select('field_name[0]', 'value=Contact');
index 77608a0191f21c82cb6bbbe9e3e8631a8708997e..f9731e0a3b07e2ca0ad61711c9eb4ad527dd5143 100644 (file)
@@ -76,13 +76,11 @@ class api_v3_EmailTest extends CiviUnitTestCase {
     $delresult = $this->callAPISuccess('email', 'delete', array('id' => $result['id']));
   }
 
-  /*
+  /**
    * If a new email is set to is_primary the prev should no longer be
    *
    * If is_primary is not set then it should become is_primary is no others exist
    */
-
-
   public function testCreateEmailPrimaryHandlingChangeToPrimary() {
     $params = $this->_params;
     unset($params['is_primary']);
index dbc7b69efe93167c8d2a3389d69e658db9df171c..dbad258aa76ab021ec074e4a98aa07f381b6a96c 100644 (file)
@@ -108,7 +108,7 @@ class api_v3_GroupNestingTest extends CiviUnitTestCase {
         'id' => 1,
         'child_group_id' => 2,
         'parent_group_id' => 1,
-      )
+      ),
     );
 
     $this->assertEquals($expected, $result['values']);
index 5dcf9a59fd28a88c2c4a5baf7e1f3e45bbd8c102..96c06696954a57b4492e83ef4aabd452d53e2269 100644 (file)
@@ -1,29 +1,29 @@
 <?php
 /*
- +--------------------------------------------------------------------+
- | CiviCRM version 4.6                                                |
- +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014                                |
- +--------------------------------------------------------------------+
- | This file is a part of CiviCRM.                                    |
- |                                                                    |
- | CiviCRM is free software; you can copy, modify, and distribute it  |
- | under the terms of the GNU Affero General Public License           |
- | Version 3, 19 November 2007 and the CiviCRM Licensing Exception.   |
- |                                                                    |
- | CiviCRM is distributed in the hope that it will be useful, but     |
- | WITHOUT ANY WARRANTY; without even the implied warranty of         |
- | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.               |
- | See the GNU Affero General Public License for more details.        |
- |                                                                    |
- | You should have received a copy of the GNU Affero General Public   |
- | License and the CiviCRM Licensing Exception along                  |
- | with this program; if not, contact CiviCRM LLC                     |
- | at info[AT]civicrm[DOT]org. If you have questions about the        |
- | GNU Affero General Public License or the licensing of CiviCRM,     |
- | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
- +--------------------------------------------------------------------+
- */
 +--------------------------------------------------------------------+
 | CiviCRM version 4.6                                                |
 +--------------------------------------------------------------------+
 | Copyright CiviCRM LLC (c) 2004-2014                                |
 +--------------------------------------------------------------------+
 | This file is a part of CiviCRM.                                    |
 |                                                                    |
 | CiviCRM is free software; you can copy, modify, and distribute it  |
 | under the terms of the GNU Affero General Public License           |
 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception.   |
 |                                                                    |
 | CiviCRM is distributed in the hope that it will be useful, but     |
 | WITHOUT ANY WARRANTY; without even the implied warranty of         |
 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.               |
 | See the GNU Affero General Public License for more details.        |
 |                                                                    |
 | You should have received a copy of the GNU Affero General Public   |
 | License and the CiviCRM Licensing Exception along                  |
 | with this program; if not, contact CiviCRM LLC                     |
 | at info[AT]civicrm[DOT]org. If you have questions about the        |
 | GNU Affero General Public License or the licensing of CiviCRM,     |
 | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
 +--------------------------------------------------------------------+
+*/
 
 require_once 'CiviTest/CiviUnitTestCase.php';
 
@@ -74,12 +74,14 @@ class api_v3_MembershipTypeTest extends CiviUnitTestCase {
     $this->membershipTypeDelete($params);
   }
 
-  ///////////////// civicrm_membership_type_create methods
+  /**
+   * Civicrm_membership_type_create methods.
+   */
   public function testCreateWithEmptyParams() {
     $membershiptype = $this->callAPIFailure('membership_type', 'create', array());
     $this->assertEquals($membershiptype['error_message'],
       'Mandatory key(s) missing from params array: domain_id, member_of_contact_id, financial_type_id, duration_unit, duration_interval, name'
-    );
+                       );
   }
 
   public function testCreateWithoutMemberOfContactId() {
@@ -96,8 +98,8 @@ class api_v3_MembershipTypeTest extends CiviUnitTestCase {
     );
 
     $membershiptype = $this->callAPIFailure('membership_type', 'create', $params,
-      'Mandatory key(s) missing from params array: member_of_contact_id'
-    );
+                      'Mandatory key(s) missing from params array: member_of_contact_id'
+                                           );
   }
 
   public function testCreateWithoutContributionTypeId() {
@@ -115,7 +117,7 @@ class api_v3_MembershipTypeTest extends CiviUnitTestCase {
     $membershiptype = $this->callAPIFailure('membership_type', 'create', $params);
     $this->assertEquals($membershiptype['error_message'],
       'Mandatory key(s) missing from params array: financial_type_id'
-    );
+                       );
   }
 
   public function testCreateWithoutDurationUnit() {
@@ -133,7 +135,7 @@ class api_v3_MembershipTypeTest extends CiviUnitTestCase {
     $membershiptype = $this->callAPIFailure('membership_type', 'create', $params);
     $this->assertEquals($membershiptype['error_message'],
       'Mandatory key(s) missing from params array: duration_unit'
-    );
+                       );
   }
 
   public function testCreateWithoutDurationInterval() {
@@ -150,7 +152,7 @@ class api_v3_MembershipTypeTest extends CiviUnitTestCase {
     $membershiptype = $this->callAPIFailure('membership_type', 'create', $params);
     $this->assertEquals($membershiptype['error_message'],
       'Mandatory key(s) missing from params array: financial_type_id, duration_interval'
-    );
+                       );
   }
 
   public function testCreateWithoutNameandDomainIDandDurationUnit() {
@@ -167,7 +169,7 @@ class api_v3_MembershipTypeTest extends CiviUnitTestCase {
     $membershiptype = $this->callAPIFailure('membership_type', 'create', $params);
     $this->assertEquals($membershiptype['error_message'],
       'Mandatory key(s) missing from params array: domain_id, duration_unit, name'
-    );
+                       );
   }
 
   public function testCreateWithoutName() {
@@ -212,7 +214,7 @@ class api_v3_MembershipTypeTest extends CiviUnitTestCase {
     $membershiptype = $this->callAPIFailure('membership_type', 'create', $params);
     $this->assertEquals($membershiptype['error_message'],
       'Mandatory key(s) missing from params array: domain_id, member_of_contact_id, financial_type_id, duration_unit, duration_interval, name'
-    );
+                       );
   }
 
   public function testUpdateWithoutId() {
@@ -263,8 +265,8 @@ class api_v3_MembershipTypeTest extends CiviUnitTestCase {
       'id' => 'doesNotExist',
     );
     $membershiptype = $this->callAPIFailure('membership_type', 'delete', $params,
-      'Error while deleting membership type. id : ' . $params['id']
-    );
+                      'Error while deleting membership type. id : ' . $params['id']
+                                           );
   }
 
   public function testDelete() {
index 8b6899d785d236ddc2b02c40638b07a984184a1f..77aa3a4b99f226b3e78b0a1605f584dc3126e28b 100644 (file)
@@ -45,10 +45,9 @@ class api_v3_OptionGroupTest extends CiviUnitTestCase {
     );
   }
 
-  /*
-  * Good to test option group as a representative on the Camel Case
-  */
-
+  /**
+   * Good to test option group as a representative on the Camel Case
+   */
   public function testGetOptionGroupGetFields() {
     $result = $this->callAPISuccess('option_group', 'getfields', array());
     $this->assertFalse(empty($result['values']), 'In line ' . __LINE__);
@@ -94,20 +93,19 @@ class api_v3_OptionGroupTest extends CiviUnitTestCase {
         'value' => 35,
         'is_default' => 1,
         'is_active' => 1,
-        'format.only_id' => 1
-      )
+        'format.only_id' => 1,
+      ),
     );
     $result = $this->callAPIAndDocument('OptionGroup', 'create', $params, __FUNCTION__, __FILE__);
     $this->assertEquals('civicrm_event.amount.560', $result['values'][0]['name'], 'In line ' . __LINE__);
-    $this->assertTrue(is_integer($result['values'][0]['api.OptionValue.create']));
+    $this->assertTrue(is_int($result['values'][0]['api.OptionValue.create']));
     $this->assertGreaterThan(0, $result['values'][0]['api.OptionValue.create']);
     $this->callAPISuccess('OptionGroup', 'delete', array('id' => $result['id']));
   }
 
-  /*
+  /**
    * Test the error message when a failure is due to a key duplication issue
    */
-
   public function testGetOptionCreateFailOnDuplicate() {
     $params = array(
       'sequential' => 1,
@@ -120,11 +118,11 @@ class api_v3_OptionGroupTest extends CiviUnitTestCase {
     $this->callAPISuccess('OptionGroup', 'delete', array('id' => $result1['id']));
   }
 
-  /*
+  /**
    * Test that transaction is completely rolled back on fail.
-   * Also check error returned
+   *
+   * Check error returned.
    */
-
   public function testGetOptionCreateFailRollback() {
     $countFirst = $this->callAPISuccess('OptionGroup', 'getcount', array(
         'options' => array('limit' => 5000),
index 9b0f8a1a1e2173e2a68849ae66628b0cb942bd64..2b7bb51b3d226f427614b44d068e7b3e487a9953 100644 (file)
@@ -1,11 +1,11 @@
 module('group a');
 
-test( "a basic test example", function() {
+test("a basic test example", function() {
   var value = "hello";
-  equal( value, "hello", "We expect value to be hello" );
+  equal(value, "hello", "We expect value to be hello");
 });
 
-test( "another basic test example", function() {
+test("another basic test example", function() {
   var value = "hello";
-  equal( value, "hello", "We expect value to be hello" );
+  equal(value, "hello", "We expect value to be hello");
 });