Merge pull request #15699 from mattwire/participant_cleanup_completeOrderPBRef
[civicrm-core.git] / CRM / Extension / Container / Collection.php
index a3f541cbf281d1a91d4e1e0d0c6585192cc605f6..6c37209bac65746d081f6d2995dc83edfa44c10e 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.                                    |
  |                                                                    |
@@ -27,7 +27,7 @@
 
 /**
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2019
+ * @copyright CiviCRM LLC (c) 2004-2020
  */
 
 /**
 class CRM_Extension_Container_Collection implements CRM_Extension_Container_Interface {
 
   /**
-   * @var array ($name => CRM_Extension_Container_Interface)
+   * Containers.
+   *
+   * Format is [$name => CRM_Extension_Container_Interface]
+   *
+   * @var array
    *
    * Note: Treat as private. This is only public to facilitate debugging.
    */
   public $containers;
 
   /**
-   * @var CRM_Utils_Cache_Interface|NULL
+   * @var CRM_Utils_Cache_Interface|null
    *
    * Note: Treat as private. This is only public to facilitate debugging.
    */
   public $cache;
 
   /**
-   * @var string the cache key used for any data stored by this container
+   * The cache key used for any data stored by this container.
+   *
+   * @var string
    *
    * Note: Treat as private. This is only public to facilitate debugging.
    */
   public $cacheKey;
 
   /**
-   * @var array ($key => $containerName)
+   * K2C ....
+   *
+   * Format is ($key => $containerName).
+   *
+   * @var array
    *
    * Note: Treat as private. This is only public to facilitate debugging.
    */
   public $k2c;
 
   /**
+   * Class constructor.
+   *
    * @param array $containers
    *   Array($name => CRM_Extension_Container_Interface) in order from highest
    *   priority (winners) to lowest priority (losers).
@@ -85,7 +97,7 @@ class CRM_Extension_Container_Collection implements CRM_Extension_Container_Inte
    * @return array
    */
   public function checkRequirements() {
-    $errors = array();
+    $errors = [];
     foreach ($this->containers as $container) {
       $errors = array_merge($errors, $container->checkRequirements());
     }
@@ -95,7 +107,7 @@ class CRM_Extension_Container_Collection implements CRM_Extension_Container_Inte
   /**
    * @inheritDoc
    *
-   * @return array_keys
+   * @return array
    */
   public function getKeys() {
     $k2c = $this->getKeysToContainer();
@@ -106,6 +118,8 @@ class CRM_Extension_Container_Collection implements CRM_Extension_Container_Inte
    * @inheritDoc
    *
    * @param string $key
+   *
+   * @throws \CRM_Extension_Exception_MissingException
    */
   public function getPath($key) {
     return $this->getContainer($key)->getPath($key);
@@ -115,6 +129,8 @@ class CRM_Extension_Container_Collection implements CRM_Extension_Container_Inte
    * @inheritDoc
    *
    * @param string $key
+   *
+   * @throws \CRM_Extension_Exception_MissingException
    */
   public function getResUrl($key) {
     return $this->getContainer($key)->getResUrl($key);
@@ -163,7 +179,7 @@ class CRM_Extension_Container_Collection implements CRM_Extension_Container_Inte
       $k2c = $this->cache->get($this->cacheKey);
     }
     if (!isset($k2c) || !is_array($k2c)) {
-      $k2c = array();
+      $k2c = [];
       $containerNames = array_reverse(array_keys($this->containers));
       foreach ($containerNames as $name) {
         $keys = $this->containers[$name]->getKeys();