1
0
mirror of https://github.com/php/phd.git synced 2026-03-24 07:02:07 +01:00
Files
archived-phd/phpdotnet/phd/ReaderKeeper.php
2025-01-14 12:16:32 +00:00

48 lines
767 B
PHP

<?php
namespace phpdotnet\phd;
class ReaderKeeper
{
/**
* Array of reader objects.
*
* @var array
*/
protected static $r = array();
/**
* Appends a reader object to the stack.
*
* @param Reader $r Reader to append
*
* @return void
*/
public static function setReader(Reader $r)
{
self::$r[] = $r;
}
/**
* Returns the reader from the top of the stack.
*
* @return Reader Reader object
*/
public static function getReader()
{
return end(self::$r);
}
/**
* Removes the reader from the top of the stack.
*
* @return mixed
*/
public static function popReader()
{
return array_pop(self::$r);
}
}