1 | <?php |
||
18 | class Collection implements \IteratorAggregate |
||
19 | { |
||
20 | /** |
||
21 | * @var int |
||
22 | */ |
||
23 | private static $lastId = 0; |
||
24 | |||
25 | /** |
||
26 | * @var array|OpcodeInterface[] |
||
27 | */ |
||
28 | private $opcodes = []; |
||
29 | |||
30 | /** |
||
31 | * @var Context |
||
32 | */ |
||
33 | private $ctx; |
||
34 | |||
35 | /** |
||
36 | * Heap constructor. |
||
37 | * @param Context $ctx |
||
38 | */ |
||
39 | public function __construct(Context $ctx) |
||
43 | |||
44 | /** |
||
45 | * @param OpcodeInterface|Opcode $opcode |
||
46 | * @param Readable $readable |
||
47 | * @param int $offset |
||
48 | * @return Opcode|OpcodeInterface |
||
49 | */ |
||
50 | public function add(OpcodeInterface $opcode, Readable $readable, int $offset = 0): OpcodeInterface |
||
62 | |||
63 | /** |
||
64 | * @return \SplDoublyLinkedList|Opcode[]|OpcodeInterface[] |
||
65 | */ |
||
66 | public function getIterator(): iterable |
||
70 | } |
||
71 |