Merge branch 'phpunit-ob-fix' of https://github.com/giant-rabbit/civicrm-core into...
[civicrm-core.git] / CRM / Core / Session.php
index 059fb22bdd4195d87960f8c01a41c248feb3852c..3ef9a7436a5d316dae77d270f8a450dbebd490e9 100644 (file)
 
 
 require_once "PEAR.php";
+
+/**
+ * Class CRM_Core_Session
+ */
 class CRM_Core_Session {
 
   /**
@@ -35,7 +39,7 @@ class CRM_Core_Session {
   static $_managedNames = NULL;
 
   /**
-   * key is used to allow the application to have multiple top
+   * Key is used to allow the application to have multiple top
    * level scopes rather than a single scope. (avoids naming
    * conflicts). We also extend this idea further and have local
    * scopes within a global scope. Allows us to do cool things
@@ -79,14 +83,14 @@ class CRM_Core_Session {
    * This constructor is invoked whenever any module requests an instance of
    * the session and one is not available.
    *
-   * @return void
+   * @return \CRM_Core_Session
    */
   function __construct() {
     $this->_session = null;
   }
 
   /**
-   * singleton function used to manage this object
+   * Singleton function used to manage this object
    *
    * @return CRM_Core_Session
    * @static
@@ -149,6 +153,8 @@ class CRM_Core_Session {
    *
    * @access public
    *
+   * @param int $all
+   *
    * @return void
    */
   function reset($all = 1) {
@@ -167,7 +173,7 @@ class CRM_Core_Session {
   }
 
   /**
-   * creates a session local scope
+   * Creates a session local scope
    *
    * @param string  prefix local scope name
    * @param boolean isRead is this a read operation, in this case, the session will not be touched
@@ -189,7 +195,7 @@ class CRM_Core_Session {
   }
 
   /**
-   * resets the session local scope
+   * Resets the session local scope
    *
    * @param string local scope name
    * @access public
@@ -335,7 +341,7 @@ class CRM_Core_Session {
   }
 
   /**
-   * adds a userContext to the stack
+   * Adds a userContext to the stack
    *
    * @param string  $userContext the url to return to when done
    * @param boolean $check       should we do a dupe checking with the top element
@@ -375,7 +381,7 @@ class CRM_Core_Session {
   }
 
   /**
-   * replace the userContext of the stack with the passed one
+   * Replace the userContext of the stack with the passed one
    *
    * @param string the url to return to when done
    *
@@ -396,7 +402,7 @@ class CRM_Core_Session {
   }
 
   /**
-   * pops the top userContext stack
+   * Pops the top userContext stack
    *
    * @param void
    *
@@ -410,7 +416,7 @@ class CRM_Core_Session {
   }
 
   /**
-   * reads the top userContext stack
+   * Reads the top userContext stack
    *
    * @param void
    *
@@ -426,7 +432,7 @@ class CRM_Core_Session {
   }
 
   /**
-   * dumps the session to the log
+   * Dumps the session to the log
    */
   function debug($all = 1) {
     $this->initialize();
@@ -518,6 +524,9 @@ class CRM_Core_Session {
     }
   }
 
+  /**
+   * @param string $names
+   */
   static function registerAndRetrieveSessionObjects($names) {
     if (!is_array($names)) {
       $names = array($names);
@@ -533,6 +542,9 @@ class CRM_Core_Session {
     CRM_Core_BAO_Cache::restoreSessionFromCache($names);
   }
 
+  /**
+   * @param bool $reset
+   */
   static function storeSessionObjects($reset = TRUE) {
     if (empty(self::$_managedNames)) {
       return;
@@ -557,6 +569,9 @@ class CRM_Core_Session {
     return $session->get('userID');
   }
 
+  /**
+   * @return bool
+   */
   function isEmpty() {
     // check if session is empty, if so we dont cache
     // stuff that we can get away with