1 | <?php |
||
20 | class PriorityCollection implements \IteratorAggregate, \Countable |
||
21 | { |
||
22 | /** |
||
23 | * @var array[] |
||
24 | */ |
||
25 | private $_collection = []; |
||
26 | private $_cache; |
||
27 | |||
28 | |||
29 | /** |
||
30 | * Retrieve an external iterator |
||
31 | * @link http://php.net/manual/en/iteratoraggregate.getiterator.php |
||
32 | * @return Traversable An instance of an object implementing <b>Iterator</b> or |
||
33 | * <b>Traversable</b> |
||
34 | * @since 5.0.0 |
||
35 | */ |
||
36 | 7 | public function getIterator() |
|
40 | |||
41 | /** |
||
42 | * Count elements of an object |
||
43 | * @link http://php.net/manual/en/countable.count.php |
||
44 | * @return int The custom count as an integer. |
||
45 | * </p> |
||
46 | * <p> |
||
47 | * The return value is cast to an integer. |
||
48 | * @since 5.1.0 |
||
49 | */ |
||
50 | 1 | public function count() |
|
54 | |||
55 | 11 | public function insert($value, int $priority) |
|
61 | |||
62 | 1 | public function remove($value) |
|
70 | |||
71 | private function rebuildCache() |
||
79 | } |
||
80 |