Update copyright date for 2020
[civicrm-core.git] / Civi / API / Request.php
index dbf0cb1ee88c91678bf8ada65009491cff3c199d..a3fe96b916190cdfa959c86bc4c63cb57dc34d49 100644 (file)
@@ -3,7 +3,7 @@
  +--------------------------------------------------------------------+
  | CiviCRM version 5                                                  |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2019                                |
+ | Copyright CiviCRM LLC (c) 2004-2020                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
@@ -62,7 +62,7 @@ class Request {
     $version = \CRM_Utils_Array::value('version', $params);
     switch ($version) {
       default:
-        $apiRequest = array();
+        $apiRequest = [];
         $apiRequest['id'] = self::$nextId++;
         $apiRequest['version'] = (int) $version;
         $apiRequest['params'] = $params;
@@ -73,7 +73,7 @@ class Request {
         return $apiRequest;
 
       case 4:
-        $callable = array("Civi\\Api4\\$entity", $action);
+        $callable = ["Civi\\Api4\\$entity", $action];
         if (!is_callable($callable)) {
           throw new Exception\NotImplementedException("API ($entity, $action) does not exist (join the API team and implement it!)");
         }
@@ -115,4 +115,8 @@ class Request {
     return strtolower(\CRM_Utils_String::munge($action));
   }
 
+  public static function getNextId() {
+    return self::$nextId++;
+  }
+
 }