Civi\Angular - Docblock improvements.
[civicrm-core.git] / CRM / Utils / GlobalStack.php
index 717c69baac423553aacc5136ad9beeb5628131ca..b6d4a089ccf105ea2bc06fb27b8118a5205086c2 100644 (file)
@@ -1,6 +1,6 @@
 <?php /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.5                                                |
+ | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2014                                |
  +--------------------------------------------------------------------+
@@ -22,7 +22,7 @@
  | GNU Affero General Public License or the licensing of CiviCRM,     |
  | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
  +--------------------------------------------------------------------+
-*/
+ */
 
 /**
  * Temporarily change a global variable.
@@ -46,7 +46,6 @@ class CRM_Utils_GlobalStack {
    * We don't have a container or dependency-injection, so use singleton instead
    *
    * @var object
-   * @static
    */
   private static $_singleton = NULL;
 
@@ -64,6 +63,9 @@ class CRM_Utils_GlobalStack {
     return self::$_singleton;
   }
 
+  /**
+   * @param $newFrame
+   */
   public function push($newFrame) {
     $this->backups[] = $this->createBackup($newFrame);
     $this->applyFrame($newFrame);
@@ -74,8 +76,10 @@ class CRM_Utils_GlobalStack {
   }
 
   /**
-   * @param array $new the new, incoming frame
-   * @return array frame
+   * @param array $new
+   *   The new, incoming frame.
+   * @return array
+   *   frame
    */
   public function createBackup($new) {
     $frame = array();
@@ -84,22 +88,28 @@ class CRM_Utils_GlobalStack {
         foreach ($values as $key => $value) {
           $frame[$globalKey][$key] = CRM_Utils_Array::value($key, $GLOBALS[$globalKey]);
         }
-      } else {
+      }
+      else {
         $frame[$globalKey] = CRM_Utils_Array::value($globalKey, $GLOBALS);
       }
     }
     return $frame;
   }
 
+  /**
+   * @param $newFrame
+   */
   public function applyFrame($newFrame) {
     foreach ($newFrame as $globalKey => $values) {
       if (is_array($values)) {
         foreach ($values as $key => $value) {
           $GLOBALS[$globalKey][$key] = $value;
         }
-      } else {
+      }
+      else {
         $GLOBALS[$globalKey] = $values;
       }
     }
   }
+
 }