Merge pull request #16263 from eileenmcnaughton/ids_3
[civicrm-core.git] / CRM / Widget / Widget.php
index 29586c3658f18901f16886d393785deead19110f..dbc4afe80cce8294af82ba1585eac9d934ed25e5 100644 (file)
  */
 class CRM_Widget_Widget {
 
-  static $_methodTable;
+  public static $_methodTable;
 
   public function initialize() {
     if (!self::$_methodTable) {
-      self::$_methodTable = array(
-        'getContributionPageData' => array(
+      self::$_methodTable = [
+        'getContributionPageData' => [
           'description' => 'Gets all campaign related data and returns it as a std class.',
           'access' => 'remote',
-          'arguments' => array(
+          'arguments' => [
             'contributionPageID',
             'widgetID',
-          ),
-        ),
-        'getEmbedCode' => array(
+          ],
+        ],
+        'getEmbedCode' => [
           'description' => 'Gets embed code.  Perhaps overkill, but we can track dropoffs in this case. by # of people requesting embed code / number of unique instances.',
           'access' => 'remote',
-          'arguments' => array(
+          'arguments' => [
             'contributionPageID',
             'widgetID',
             'format',
-          ),
-        ),
-      );
+          ],
+        ],
+      ];
     }
   }
 
@@ -109,7 +109,7 @@ FROM   civicrm_contribution
 WHERE  is_test = 0
 AND    contribution_status_id = 1
 AND    contribution_page_id = %1";
-    $params = array(1 => array($contributionPageID, 'Integer'));
+    $params = [1 => [$contributionPageID, 'Integer']];
     $dao = CRM_Core_DAO::executeQuery($query, $params);
     if ($dao->fetch()) {
       $data->num_donors = $dao->count;
@@ -123,7 +123,7 @@ AND    contribution_page_id = %1";
 SELECT goal_amount, start_date, end_date, is_active
 FROM   civicrm_contribution_page
 WHERE  id = %1";
-    $params = array(1 => array($contributionPageID, 'Integer'));
+    $params = [1 => [$contributionPageID, 'Integer']];
     $dao = CRM_Core_DAO::executeQuery($query, $params);
     if ($dao->fetch()) {
       $data->money_target = $dao->goal_amount;
@@ -158,7 +158,7 @@ WHERE  id = %1";
     $data->homepage_link = $widget->url_homepage;
 
     // movie clip colors, must be in '0xRRGGBB' format
-    $data->colors = array();
+    $data->colors = [];
 
     $hexPrefix = '0x';
     $data->colors["title"] = str_replace('#', $hexPrefix, $widget->color_title);