| 1 | <?php | ||
| 8 | class Stack implements StackInterface | ||
| 9 | { | ||
| 10 | use CallableStackTrait; | ||
| 11 | |||
| 12 | /** | ||
| 13 | * Create new stack. | ||
| 14 | * | ||
| 15 | * @param callable $bottomMiddleware last middleware to be called | ||
| 16 | */ | ||
| 17 | public function __construct(callable $bottomMiddleware = null) | ||
| 21 | |||
| 22 | /** | ||
| 23 | * Push a middleware onto the top of a new Stack instance. | ||
| 24 | * | ||
| 25 | * @param callable $newTopMiddleware the middleware to be pushed onto the top. | ||
| 26 | * | ||
| 27 | * @return static the new instance | ||
| 28 | */ | ||
| 29 | public function add(callable $newTopMiddleware) | ||
| 35 | |||
| 36 | /** | ||
| 37 | * Create new stack. | ||
| 38 | * | ||
| 39 | * @param callable $bottomMiddleware last middleware to be called | ||
| 40 | * | ||
| 41 | * @return static a new stack instance | ||
| 42 | */ | ||
| 43 | public static function create(callable $bottomMiddleware = null) | ||
| 47 | } | ||
| 48 |