function pushNamed ($stackerName, $value);
/**
- * 'Pops' a value from a named stacker
+ * 'Pops' a value from a named stacker and returns it's value
*
* @param $stackerName Name of the stacker
- * @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
*/
function popNamed ($stackerName);
/**
- * Get value from named stacker
+ * Get value from named stacker but don't "pop" it
*
* @param $stackerName Name of the stacker
* @return $value Value of last added value
}
/**
- * '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;
}
/**
}
/**
- * '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;
}
/**