INFRA-132 comments to end with full stops
[civicrm-core.git] / CRM / Report / Form / Extended.php
index 2ae6e145ef5605c3022f113c4e355907c6f7f8d8..7effc2e17249e7223c8bd61797c7a2cb160625aa 100644 (file)
@@ -23,7 +23,7 @@
  | GNU Affero General Public License or the licensing of CiviCRM,     |
  | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
  +--------------------------------------------------------------------+
-*/
+ */
 
 /**
  *
@@ -128,7 +128,13 @@ class CRM_Report_Form_Extended extends CRM_Report_Form {
   }
 
   /**
+   * Alter display of rows.
+   *
+   * Iterate through the rows retrieved via SQL and make changes for display purposes,
+   * such as rendering contacts as links.
+   *
    * @param array $rows
+   *   Rows generated by SQL, with an array for each row.
    */
   public function alterDisplay(&$rows) {
     parent::alterDisplay($rows);
@@ -250,12 +256,12 @@ class CRM_Report_Form_Extended extends CRM_Report_Form {
         // are grouped together across price sets but there may be a separate need to group
         // by id so that entries in one price set are distinct from others. Not quite sure what
         // to call the distinction for end users benefit
-          array(
-            'price_field_value_label' => array(
-              'title' => ts('Price Field Value Label'),
-              'name' => 'label',
-            ),
+        array(
+          'price_field_value_label' => array(
+            'title' => ts('Price Field Value Label'),
+            'name' => 'label',
           ),
+        ),
       ),
     );
   }
@@ -596,8 +602,7 @@ class CRM_Report_Form_Extended extends CRM_Report_Form {
         'filters' => array(
           'id' => array(
             'title' => ts('Contact ID'),
-          )
-        ,
+          ),
           'sort_name' => array(
             'title' => ts('Contact Name'),
           ),
@@ -699,7 +704,7 @@ class CRM_Report_Form_Extended extends CRM_Report_Form {
   }
 
   /**
-   * Get address columns to add to array
+   * Get address columns to add to array.
    *
    * @param array $options
    *   Options for the report.
@@ -760,21 +765,18 @@ class CRM_Report_Form_Extended extends CRM_Report_Form {
             'title' => ts($options['prefix_label'] . 'Street Number'),
             'type' => 1,
             'default' => CRM_Utils_Array::value('street_number', $options['defaults'], FALSE),
-            'name' => 'street_number',
           ),
           $options['prefix'] . 'street_name' => array(
             'name' => 'street_name',
             'title' => ts($options['prefix_label'] . 'Street Name'),
             'type' => 1,
             'default' => CRM_Utils_Array::value('street_name', $options['defaults'], FALSE),
-            'name' => 'street_name',
           ),
           $options['prefix'] . 'street_unit' => array(
             'name' => 'street_unit',
             'title' => ts($options['prefix_label'] . 'Street Unit'),
             'type' => 1,
             'default' => CRM_Utils_Array::value('street_unit', $options['defaults'], FALSE),
-            'name' => 'street_unit',
           ),
           $options['prefix'] . 'city' => array(
             'title' => ts($options['prefix_label'] . 'City'),
@@ -913,7 +915,7 @@ class CRM_Report_Form_Extended extends CRM_Report_Form {
   }
 
   /**
-   * Get Information about advertised Joins
+   * Get Information about advertised Joins.
    *
    * @return array
    */
@@ -1029,7 +1031,7 @@ class CRM_Report_Form_Extended extends CRM_Report_Form {
   }
 
   /**
-   * Define join from line item table to participant table
+   * Define join from line item table to participant table.
    */
   public function joinParticipantFromLineItem() {
     $this->_from .= " LEFT JOIN civicrm_participant {$this->_aliases['civicrm_participant']}
@@ -1054,7 +1056,7 @@ class CRM_Report_Form_Extended extends CRM_Report_Form {
   }
 
   /**
-   * Define join from Participant to Contribution table
+   * Define join from Participant to Contribution table.
    */
   public function joinContributionFromParticipant() {
     $this->_from .= " LEFT JOIN civicrm_participant_payment pp
@@ -1065,7 +1067,7 @@ class CRM_Report_Form_Extended extends CRM_Report_Form {
   }
 
   /**
-   * Define join from Membership to Contribution table
+   * Define join from Membership to Contribution table.
    */
   public function joinContributionFromMembership() {
     $this->_from .= " LEFT JOIN civicrm_membership_payment pp
@@ -1216,7 +1218,7 @@ WHERE   line_item_civireport.id IS NOT NULL
   }
 
   /**
-   * Retrieve text for financial type from pseudoconstant
+   * Retrieve text for financial type from pseudoconstant.
    *
    * @param $value
    * @param array $row
@@ -1225,7 +1227,7 @@ WHERE   line_item_civireport.id IS NOT NULL
    */
   public function alterNickName($value, &$row) {
     if (empty($row['civicrm_contact_id'])) {
-      return;
+      return NULL;
     }
     $contactID = $row['civicrm_contact_id'];
     return "<div id=contact-{$contactID} class='crm-entity'>
@@ -1234,7 +1236,7 @@ WHERE   line_item_civireport.id IS NOT NULL
   }
 
   /**
-   * Retrieve text for contribution type from pseudoconstant
+   * Retrieve text for contribution type from pseudoconstant.
    *
    * @param $value
    * @param array $row
@@ -1246,7 +1248,7 @@ WHERE   line_item_civireport.id IS NOT NULL
   }
 
   /**
-   * Retrieve text for contribution status from pseudoconstant
+   * Retrieve text for contribution status from pseudoconstant.
    *
    * @param $value
    * @param array $row
@@ -1258,7 +1260,7 @@ WHERE   line_item_civireport.id IS NOT NULL
   }
 
   /**
-   * Retrieve text for payment instrument from pseudoconstant
+   * Retrieve text for payment instrument from pseudoconstant.
    *
    * @param $value
    * @param array $row
@@ -1377,7 +1379,7 @@ WHERE   line_item_civireport.id IS NOT NULL
    */
   public function alterParticipantStatus($value) {
     if (empty($value)) {
-      return;
+      return NULL;
     }
     return CRM_Event_PseudoConstant::participantStatus($value, FALSE, 'label');
   }
@@ -1389,7 +1391,7 @@ WHERE   line_item_civireport.id IS NOT NULL
    */
   public function alterParticipantRole($value) {
     if (empty($value)) {
-      return;
+      return NULL;
     }
     $roles = explode(CRM_Core_DAO::VALUE_SEPARATOR, $value);
     $value = array();
@@ -1408,4 +1410,5 @@ WHERE   line_item_civireport.id IS NOT NULL
     $paymentInstruments = CRM_Contribute_PseudoConstant::paymentInstrument();
     return $paymentInstruments[$value];
   }
+
 }