Merge remote-tracking branch 'upstream/4.5' into 4.5-master-2015-02-02-18-36-16
[civicrm-core.git] / CRM / Extension / Container / Static.php
index 3809c06e9cd8bf8b9ea5078e85c54a9d77dc730e..f462fde7917f83b9ea7c4a5173f1381394fdc519 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.3                                                |
+ | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013                                |
+ | Copyright CiviCRM LLC (c) 2004-2014                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
  | GNU Affero General Public License or the licensing of CiviCRM,     |
  | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
  +--------------------------------------------------------------------+
-*/
+ */
 
 /**
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2013
+ * @copyright CiviCRM LLC (c) 2004-2014
  * $Id$
  */
 
  * scanned for extensions.
  */
 class CRM_Extension_Container_Static implements CRM_Extension_Container_Interface {
+  /**
+   * @param array $exts
+   *   Array(string $key => array $spec) List of extensions.
+   */
   public function __construct($exts) {
     $this->exts = $exts;
   }
 
   /**
-   * {@inheritdoc}
+   * @inheritDoc
    */
   public function checkRequirements() {
     return array();
   }
 
   /**
-   * {@inheritdoc}
+   * @inheritDoc
    */
   public function getName() {
     return $this->name;
   }
 
   /**
-   * {@inheritdoc}
+   * @inheritDoc
    */
   public function getKeys() {
     return array_keys($this->exts);
   }
 
   /**
-   * {@inheritdoc}
+   * @inheritDoc
    */
   public function getPath($key) {
     $e = $this->getExt($key);
@@ -70,7 +74,7 @@ class CRM_Extension_Container_Static implements CRM_Extension_Container_Interfac
   }
 
   /**
-   * {@inheritdoc}
+   * @inheritDoc
    */
   public function getResUrl($key) {
     $e = $this->getExt($key);
@@ -78,16 +82,24 @@ class CRM_Extension_Container_Static implements CRM_Extension_Container_Interfac
   }
 
   /**
-   * {@inheritdoc}
+   * @inheritDoc
    */
   public function refresh() {
   }
 
+  /**
+   * @param string $key
+   *   Extension name.
+   *
+   * @throws CRM_Extension_Exception_MissingException
+   */
   protected function getExt($key) {
     if (isset($this->exts[$key])) {
       return $this->exts[$key];
-    } else {
+    }
+    else {
       throw new CRM_Extension_Exception_MissingException("Missing extension: $key");
     }
   }
+
 }