1 | <?php |
||
5 | class Resolutions implements \IteratorAggregate |
||
6 | { |
||
7 | /** |
||
8 | * @var Resolution[] |
||
9 | */ |
||
10 | private $resolutions; |
||
11 | |||
12 | /** |
||
13 | * @param Resolution[] $resolutions |
||
14 | */ |
||
15 | public function __construct(array $resolutions = []) |
||
19 | |||
20 | /** |
||
21 | * @param Resolution $resolution |
||
22 | */ |
||
23 | public function add(Resolution $resolution) |
||
27 | |||
28 | /** |
||
29 | * @param array $resolutions |
||
30 | */ |
||
31 | public function addCollection(array $resolutions) |
||
37 | |||
38 | /** |
||
39 | * Sort `Resolution`s by priority. |
||
40 | * |
||
41 | * The higher the priority is, the first the `Resolution` will be. |
||
42 | * |
||
43 | * @return Resolutions |
||
44 | */ |
||
45 | public function sortByPriority() |
||
53 | |||
54 | /** |
||
55 | * @return array |
||
56 | */ |
||
57 | public function toArgumentsArray() |
||
72 | |||
73 | /** |
||
74 | * {@inheritdoc). |
||
75 | */ |
||
76 | public function getIterator() |
||
80 | |||
81 | /** |
||
82 | * @return Resolution[] |
||
83 | */ |
||
84 | public function toArray() |
||
88 | |||
89 | /** |
||
90 | * @param int $expectedArguments The number of expected arguments |
||
91 | * |
||
92 | * @return array |
||
93 | */ |
||
94 | public function getMissingResolutionPositions($expectedArguments = null) |
||
112 | |||
113 | /** |
||
114 | * @return int |
||
115 | */ |
||
116 | private function getHighestPosition() |
||
126 | |||
127 | /** |
||
128 | * @param $position |
||
129 | * |
||
130 | * @return Resolution|null |
||
131 | */ |
||
132 | private function getByPosition($position) |
||
142 | } |
||
143 |