X-Git-Url: https://git.mxchange.org/?p=core.git;a=blobdiff_plain;f=inc%2Fclasses%2Fmain%2Fstacker%2Ffifo%2Fclass_FiFoStacker.php;h=29bcd709f62d9872bda5be3248b1ef2430204ede;hp=010177065feeea2bf69a5e4ae70f5473d49033bb;hb=4fbcdb435270b88c8f97e69e987cb40712e74ce4;hpb=11cbacb35e308a58c919b672b368780bd8f11661 diff --git a/inc/classes/main/stacker/fifo/class_FiFoStacker.php b/inc/classes/main/stacker/fifo/class_FiFoStacker.php index 01017706..29bcd709 100644 --- a/inc/classes/main/stacker/fifo/class_FiFoStacker.php +++ b/inc/classes/main/stacker/fifo/class_FiFoStacker.php @@ -4,7 +4,7 @@ * * @author Roland Haeder * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Core Developer Team + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Core Developer Team * @license GNU GPL 3.0 or any newer version * @link http://www.ship-simu.org * @@ -37,12 +37,12 @@ class FiFoStacker extends BaseStacker implements Stackable { * * @return $stackerInstance An instance of FiFoStacker */ - public final static function createFiFoStacker () { + public static final function createFiFoStacker () { // Get a new instance $stackerInstance = new FiFoStacker(); // Init generic stacker - $stackerInstance->initStacker('generic'); + $stackerInstance->initStack('generic'); // Return the prepared instance return $stackerInstance; @@ -62,16 +62,22 @@ class FiFoStacker 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::popFirst($stackerName); + + // Return the value + return $value; } /** @@ -84,7 +90,7 @@ class FiFoStacker extends BaseStacker implements Stackable { */ public function getNamed ($stackerName) { // Call the protected method - return parent::getLastValue($stackerName); + return parent::getFirstValue($stackerName); } }