Merge pull request #5035 from TeNNoX/master
[civicrm-core.git] / CRM / Report / Utils / Get.php
index f911298f9af5f3c92c36a262091b56304414698b..f5cbafe0d83f149a06a0e95cd8062b8a208e43c8 100644 (file)
@@ -1,5 +1,4 @@
 <?php
-
 /*
  +--------------------------------------------------------------------+
  | CiviCRM version 4.6                                                |
@@ -24,7 +23,7 @@
  | GNU Affero General Public License or the licensing of CiviCRM,     |
  | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
  +--------------------------------------------------------------------+
-*/
+ */
 
 /**
  *
@@ -41,7 +40,7 @@ class CRM_Report_Utils_Get {
    *
    * @return mixed|null
    */
-  static function getTypedValue($name, $type) {
+  public static function getTypedValue($name, $type) {
     $value = CRM_Utils_Array::value($name, $_GET);
     if ($value === NULL) {
       return NULL;
@@ -56,8 +55,10 @@ class CRM_Report_Utils_Get {
    * @param string $fieldName
    * @param $field
    * @param $defaults
+   *
+   * @return bool
    */
-  static function dateParam($fieldName, &$field, &$defaults) {
+  public static function dateParam($fieldName, &$field, &$defaults) {
     // type = 12 (datetime) is not recognized by Utils_Type::escape() method,
     // and therefore the below hack
     $type = 4;
@@ -100,7 +101,7 @@ class CRM_Report_Utils_Get {
    * @param $field
    * @param $defaults
    */
-  static function stringParam($fieldName, &$field, &$defaults) {
+  public static function stringParam($fieldName, &$field, &$defaults) {
     $fieldOP = CRM_Utils_Array::value("{$fieldName}_op", $_GET, 'like');
 
     switch ($fieldOP) {
@@ -121,6 +122,7 @@ class CRM_Report_Utils_Get {
       case 'nnll':
         $defaults["{$fieldName}_op"] = $fieldOP;
         break;
+
       case 'in':
       case 'notin':
       case 'mhas':
@@ -138,7 +140,7 @@ class CRM_Report_Utils_Get {
    * @param $field
    * @param $defaults
    */
-  static function intParam($fieldName, &$field, &$defaults) {
+  public static function intParam($fieldName, &$field, &$defaults) {
     $fieldOP = CRM_Utils_Array::value("{$fieldName}_op", $_GET, 'eq');
 
     switch ($fieldOP) {
@@ -192,10 +194,12 @@ class CRM_Report_Utils_Get {
   /**
    * @param $defaults
    */
-  static function processChart(&$defaults) {
+  public static function processChart(&$defaults) {
     $chartType = CRM_Utils_Array::value("charts", $_GET);
     if (in_array($chartType, array(
-      'barChart', 'pieChart'))) {
+      'barChart',
+      'pieChart',
+    ))) {
       $defaults["charts"] = $chartType;
     }
   }
@@ -204,7 +208,7 @@ class CRM_Report_Utils_Get {
    * @param $fieldGrp
    * @param $defaults
    */
-  static function processFilter(&$fieldGrp, &$defaults) {
+  public static function processFilter(&$fieldGrp, &$defaults) {
     // process only filters for now
     foreach ($fieldGrp as $tableName => $fields) {
       foreach ($fields as $fieldName => $field) {
@@ -229,11 +233,11 @@ class CRM_Report_Utils_Get {
     }
   }
 
-  //unset default filters
   /**
+   * unset default filters.
    * @param $defaults
    */
-  static function unsetFilters(&$defaults) {
+  public static function unsetFilters(&$defaults) {
     static $unsetFlag = TRUE;
     if ($unsetFlag) {
       foreach ($defaults as $field_name => $field_value) {
@@ -254,7 +258,7 @@ class CRM_Report_Utils_Get {
    * @param $fieldGrp
    * @param $defaults
    */
-  static function processGroupBy(&$fieldGrp, &$defaults) {
+  public static function processGroupBy(&$fieldGrp, &$defaults) {
     // process only group_bys for now
     $flag = FALSE;
 
@@ -282,7 +286,7 @@ class CRM_Report_Utils_Get {
    * @param $reportFields
    * @param $defaults
    */
-  static function processFields(&$reportFields, &$defaults) {
+  public static function processFields(&$reportFields, &$defaults) {
     //add filters from url
     if (is_array($reportFields)) {
       if ($urlFields = CRM_Utils_Array::value("fld", $_GET)) {
@@ -303,5 +307,5 @@ class CRM_Report_Utils_Get {
       }
     }
   }
-}
 
+}