popNamed() does also now return the current stacker's value.
[core.git] / inc / classes / main / stacker / filo / class_FiLoStacker.php
index 1a80cef2a2f1e39b479912f285088b3b90bdd9a3..81604945e974d2e91342d7e560bf7c9543569cc1 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -37,7 +37,7 @@ class FiLoStacker extends BaseStacker implements Stackable {
         *
         * @return      $stackerInstance        An instance of FiLoStacker
         */
-       public final static function createFiLoStacker () {
+       public static final function createFiLoStacker () {
                // Get a new instance
                $stackerInstance = new FiLoStacker();
 
@@ -62,16 +62,22 @@ class FiLoStacker extends BaseStacker implements Stackable {
        }
 
        /**
-        * 'Pops' a value from a named stacker
+        * 'Pops' a value from a named stacker and returns it's value
         *
         * @param       $stackerName    Name of the stack
-        * @return      void
+        * @return      $value                  Value of the current stack entry
         * @throws      NoStackerException      If the named stacker was not found
         * @throws      EmptyStackerException   If the named stacker is empty
         */
        public function popNamed ($stackerName) {
+               // Get the value
+               $value = $this->getNamed($stackerName();
+
                // Call the protected method
                parent::popLast($stackerName);
+
+               // Return the value
+               return $value;
        }
 
        /**