comments & formatting fixes
authorEileen McNaughton <eileen@fuzion.co.nz>
Sat, 3 May 2014 18:44:28 +0000 (11:44 -0700)
committerEileen McNaughton <eileen@fuzion.co.nz>
Sat, 3 May 2014 18:44:28 +0000 (11:44 -0700)
CRM/Contribute/BAO/Contribution.php
CRM/Member/BAO/Membership.php
CRM/Member/Form/Membership.php
tests/phpunit/api/v3/SyntaxConformanceTest.php

index d4564a378f7fd64a9f6aceb558bd6eda41eea294..04e461e1464bacb06235c39e2797556a49815ff0 100644 (file)
@@ -491,6 +491,9 @@ class CRM_Contribute_BAO_Contribution extends CRM_Contribute_DAO_Contribution {
    * scheme. Adding weight is super important and should be done in the
    * next week or so, before this can be called complete.
    *
+   * @param string $contactType
+   * @param bool $status
+   *
    * @return array array of importable Fields
    * @access public
    * @static
@@ -690,8 +693,9 @@ INNER JOIN  civicrm_contact contact ON ( contact.id = civicrm_contribution.conta
   /**
    * Delete the indirect records associated with this contribution first
    *
-   * @return $results no of deleted Contribution on success, false otherwise
-   * @access public
+   * @param $id
+   *
+   * @return mixed|null $results no of deleted Contribution on success, false otherwise@access public
    * @static
    */
   static function deleteContribution($id) {
index fd53c7a396ba0d08654e3fc4e6a143f632ffc85f..39f92236d8dc3dc418665a0aaaa7ff6b7c0a8638 100644 (file)
@@ -216,9 +216,13 @@ class CRM_Member_BAO_Membership extends CRM_Member_DAO_Membership {
   /**
    * takes an associative array and creates a membership object
    *
-   * @param array    $params      (reference ) an assoc array of name/value pairs
-   * @param array    $ids         the array that holds all the db ids
-   * @param boolean  $callFromAPI Is this function called from API?
+   * @param array $params (reference ) an assoc array of name/value pairs
+   * @param array $ids the array that holds all the db ids
+   * @param bool $skipRedirect
+   * @param string $activityType
+   *
+   * @throws CRM_Core_Exception
+   * @internal param bool $callFromAPI Is this function called from API?
    *
    * @return object CRM_Member_BAO_Membership object
    * @access public
@@ -270,7 +274,8 @@ class CRM_Member_BAO_Membership extends CRM_Member_DAO_Membership {
     //    CRM_Contact_BAO_Relationship::relatedMemberships()
     if (isset($params['owner_membership_id'])) {
       unset($params['max_related']);
-    } else {
+    }
+    else {
       // if membership allows related, default max_related to value in membership_type
       if (!array_key_exists('max_related', $params) && !empty($params['membership_type_id'])) {
         $membershipType = CRM_Member_BAO_MembershipType::getMembershipTypeDetails($params['membership_type_id']);
@@ -477,10 +482,11 @@ class CRM_Member_BAO_Membership extends CRM_Member_DAO_Membership {
    * full featured over a period of time. This is the inverse function of
    * create.  It also stores all the retrieved values in the default array
    *
-   * @param array $params   (reference ) an assoc array of name/value pairs
+   * @param array $params (reference ) an assoc array of name/value pairs
    * @param array $defaults (reference ) an assoc array to hold the name / value pairs
    *                        in a hierarchical manner
-   * @param array $ids      (reference) the array that holds all the db ids
+   *
+   * @internal param array $ids (reference) the array that holds all the db ids
    *
    * @return object CRM_Member_BAO_Membership object
    * @access public
@@ -2010,8 +2016,10 @@ WHERE  civicrm_membership.contact_id = civicrm_contact.id
    * function to create memberships for related contacts
    * takes into account the maximum related memberships
    *
-   * @param  array      $params       array of key - value pairs
-   * @param  object     $membership   membership object
+   * @param  array $params array of key - value pairs
+   * @param $dao
+   *
+   * @internal param object $membership membership object
    *
    * @return null|relatedMembership     array of memberships if created
    * @static
@@ -2144,7 +2152,8 @@ WHERE  civicrm_membership.contact_id = civicrm_contact.id
         if (($params['status_id'] == $deceasedStatusId) || ($params['status_id'] == $expiredStatusId)) {
           // related membership is not active so does not count towards maximum
           CRM_Member_BAO_Membership::create($params, $relMemIds);
-        } else {
+        }
+        else {
           // related membership already exists, so this is just an update
           if (isset($params['id'])) {
             if ($available > 0) {
index 8a7357c0a4d3e9babb8b984c0bc4b9321803e466..f8881395b6beff8500c149764902f6ee2c00eef7 100644 (file)
@@ -978,9 +978,9 @@ WHERE   id IN ( ' . implode(' , ', array_keys($membershipType)) . ' )';
               'is_current_member' => 0,
             ));
             $tmp_statuses = $result['values'];
-            $status_ids = array(); 
+            $status_ids = array();
            foreach($tmp_statuses as $cur_stat) {
-              $status_ids[] = $cur_stat['id']; 
+              $status_ids[] = $cur_stat['id'];
             }
             if (empty($params['status_id']) || in_array( $params['status_id'] , $status_ids) == false) {
               $errors['status_id'] = ts('Please enter a status that does NOT represent a current membership status.');
@@ -1736,10 +1736,11 @@ WHERE   id IN ( ' . implode(' , ', array_keys($membershipType)) . ' )';
   /**
    * Function to send email receipt
    *
-   * @param object $form   form object
-   * @param array $values submitted values
+   * @param object $form form object
+   * @param $formValues
    * @param object $membership object
    *
+   * @internal param array $values submitted values
    * @return boolean true if mail was sent successfully
    * @static
    */
index 30471ad329290597bc1e878ceab229cecbcbc709..e0eb54a8e9ed5e3b7313e7ec9e4ddd29d6fe9463 100644 (file)
@@ -46,6 +46,8 @@ class api_v3_SyntaxConformanceTest extends CiviUnitTestCase {
   /** This test case doesn't require DB reset */
   public $DBResetRequired = FALSE;
 
+  protected $_entity;
+
   /* they are two types of missing APIs:
        - Those that are to be implemented
          (in some future version when someone steps in -hint hint-). List the entities in toBeImplemented[ {$action} ]
@@ -561,7 +563,10 @@ class api_v3_SyntaxConformanceTest extends CiviUnitTestCase {
    * sense for which entities support createTestObject
    *
    * @dataProvider entities_getlimit
-   * @param string $entity
+   *
+   * @param $entityName
+   *
+   * @internal param string $entity
    */
   function testLimit($entityName) {
     $cases = array(); // each case is array(0 => $inputtedApiOptions, 1 => $expectedResultCount)
@@ -1026,9 +1031,15 @@ class api_v3_SyntaxConformanceTest extends CiviUnitTestCase {
     );
   }
 
-/**
- * @param entityName
- */private function getMockableBAOObjects($entityName, $count = 2) {
+  /**
+   * @param $entityName
+   * @param int $count
+   *
+   * @internal param $entityName
+   *
+   * @return array
+   */
+  private function getMockableBAOObjects($entityName, $count = 2) {
     $baoString = _civicrm_api3_get_DAO($entityName);
     if (empty($baoString)) {
       $this->markTestIncomplete("Entity [$entityName] cannot be mocked - no known DAO");