| 1 | <?php |
||
| 19 | class MiddlewareQueue implements IteratorAggregate |
||
| 20 | { |
||
| 21 | /** @var SplPriorityQueue middleware */ |
||
| 22 | protected $queue; |
||
| 23 | |||
| 24 | 4 | public function __construct() |
|
| 28 | |||
| 29 | /** |
||
| 30 | * Adds middleware to queue |
||
| 31 | * |
||
| 32 | * @param MiddlewareInterface $middleware |
||
| 33 | * @param int $priority |
||
| 34 | * @return \self |
||
| 35 | */ |
||
| 36 | 4 | public function add(MiddlewareInterface $middleware, int $priority = 100): self |
|
| 41 | |||
| 42 | /** |
||
| 43 | * Implements IteratorAggregate |
||
| 44 | * |
||
| 45 | * @return Traversable |
||
| 46 | */ |
||
| 47 | 4 | public function getIterator(): Traversable |
|
| 51 | } |
||
| 52 |