Merge pull request #13993 from eileenmcnaughton/recur_fixes
[civicrm-core.git] / CRM / Case / XMLRepository.php
index ad088e8223e329a84c20bddb0e640cc788628b0c..252babe18a96afb5c663ed304a0036d8d4b4b92f 100644 (file)
@@ -3,7 +3,7 @@
  +--------------------------------------------------------------------+
  | CiviCRM version 5                                                  |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2018                                |
+ | Copyright CiviCRM LLC (c) 2004-2019                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
@@ -28,7 +28,7 @@
 /**
  *
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2018
+ * @copyright CiviCRM LLC (c) 2004-2019
  *
  * The XMLRepository is responsible for loading XML for case-types.
  * It includes any bulk operations that apply across the list of all XML
@@ -40,7 +40,7 @@ class CRM_Case_XMLRepository {
   /**
    * @var array<String,SimpleXMLElement>
    */
-  protected $xml = array();
+  protected $xml = [];
 
   /**
    * @var array|NULL
@@ -64,10 +64,10 @@ class CRM_Case_XMLRepository {
   }
 
   public function flush() {
-    $this->xml = array();
+    $this->xml = [];
     $this->hookCache = NULL;
     $this->allCaseTypes = NULL;
-    CRM_Core_DAO::$_dbColumnValueCache = array();
+    CRM_Core_DAO::$_dbColumnValueCache = [];
   }
 
   /**
@@ -76,7 +76,7 @@ class CRM_Case_XMLRepository {
    * @param array $allCaseTypes
    * @param array $xml
    */
-  public function __construct($allCaseTypes = NULL, $xml = array()) {
+  public function __construct($allCaseTypes = NULL, $xml = []) {
     $this->allCaseTypes = $allCaseTypes;
     $this->xml = $xml;
   }
@@ -176,14 +176,14 @@ class CRM_Case_XMLRepository {
       if (isset($config->customTemplateDir) && $config->customTemplateDir) {
         // check if the file exists in the custom templates directory
         $fileName = implode(DIRECTORY_SEPARATOR,
-          array(
+          [
             $config->customTemplateDir,
             'CRM',
             'Case',
             'xml',
             'configuration',
             "$caseType.xml",
-          )
+          ]
         );
       }
     }
@@ -192,24 +192,24 @@ class CRM_Case_XMLRepository {
       if (!file_exists($fileName)) {
         // check if file exists locally
         $fileName = implode(DIRECTORY_SEPARATOR,
-          array(
+          [
             dirname(__FILE__),
             'xml',
             'configuration',
             "$caseType.xml",
-          )
+          ]
         );
       }
 
       if (!file_exists($fileName)) {
         // check if file exists locally
         $fileName = implode(DIRECTORY_SEPARATOR,
-          array(
+          [
             dirname(__FILE__),
             'xml',
             'configuration.sample',
             "$caseType.xml",
-          )
+          ]
         );
       }
     }
@@ -222,7 +222,7 @@ class CRM_Case_XMLRepository {
    */
   public function getCaseTypesViaHook() {
     if ($this->hookCache === NULL) {
-      $this->hookCache = array();
+      $this->hookCache = [];
       CRM_Utils_Hook::caseTypes($this->hookCache);
     }
     return $this->hookCache;
@@ -242,7 +242,7 @@ class CRM_Case_XMLRepository {
    * @return array<string> symbolic-names of activity-types
    */
   public function getAllDeclaredActivityTypes() {
-    $result = array();
+    $result = [];
 
     $p = new CRM_Case_XMLProcessor_Process();
     foreach ($this->getAllCaseTypes() as $caseTypeName) {
@@ -259,7 +259,7 @@ class CRM_Case_XMLRepository {
    * @return array<string> symbolic-names of relationship-types
    */
   public function getAllDeclaredRelationshipTypes() {
-    $result = array();
+    $result = [];
 
     $p = new CRM_Case_XMLProcessor_Process();
     foreach ($this->getAllCaseTypes() as $caseTypeName) {