]> git.mxchange.org Git - core.git/blobdiff - inc/classes/main/stacker/filo/class_FiLoStacker.php
Added new interfaces Handleable/-DataSet and ProtocolHandler (no content yet).
[core.git] / inc / classes / main / stacker / filo / class_FiLoStacker.php
index 84efb06be0e474fcdfd21a09c100fa5518408a51..ed98efcaaa01b6f3b27a4f927fffe589ce35c5da 100644 (file)
@@ -2,11 +2,11 @@
 /**
  * A FiLo Stacker class
  *
- * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
- * @link               http://www.ship-simu.org
+ * @link               http://www.shipsimu.org
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -35,17 +35,17 @@ class FiLoStacker extends BaseStacker implements Stackable {
        /**
         * Creates an instance of the class Stacker and prepares it for usage
         *
-        * @return      $stackerInstance        An instance of FiLoStacker
+        * @return      $stackInstance  An instance of FiLoStacker
         */
        public static final function createFiLoStacker () {
                // Get a new instance
-               $stackerInstance = new FiLoStacker();
+               $stackInstance = new FiLoStacker();
 
                // Init the generic stacker
-               $stackerInstance->initStacker('generic');
+               $stackInstance->initStack('generic');
 
                // Return the prepared instance
-               return $stackerInstance;
+               return $stackInstance;
        }
 
        /**
@@ -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;
        }
 
        /**