X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FUtils%2FGlobalStack.php;h=b6d4a089ccf105ea2bc06fb27b8118a5205086c2;hb=8671b4f2efb228dc654123b391fd794b23b99d49;hp=717c69baac423553aacc5136ad9beeb5628131ca;hpb=6628866da4eb17b8ff190928d8afdbee11526ae6;p=civicrm-core.git diff --git a/CRM/Utils/GlobalStack.php b/CRM/Utils/GlobalStack.php index 717c69baac..b6d4a089cc 100644 --- a/CRM/Utils/GlobalStack.php +++ b/CRM/Utils/GlobalStack.php @@ -1,6 +1,6 @@ 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; } } } + }