1 | <?php |
||
23 | final class VersionsCollection implements Countable, IteratorAggregate |
||
24 | { |
||
25 | const SORT_ASC = 'ASC'; |
||
26 | const SORT_DESC = 'DESC'; |
||
27 | |||
28 | /** |
||
29 | * @var Version[] |
||
30 | */ |
||
31 | private $versions = []; |
||
32 | |||
33 | /** |
||
34 | * @param array $versions |
||
35 | */ |
||
36 | 10 | public function __construct(array $versions) |
|
51 | |||
52 | /** |
||
53 | * @param array $versions |
||
54 | * @return self |
||
55 | */ |
||
56 | 9 | public static function fromArray(array $versions) |
|
60 | |||
61 | /** |
||
62 | * @return int |
||
63 | */ |
||
64 | 2 | public function count() |
|
68 | |||
69 | /** |
||
70 | * @return \Iterator |
||
71 | */ |
||
72 | 5 | public function getIterator() |
|
76 | |||
77 | /** |
||
78 | * @param string|bool $direction OPTIONAL |
||
79 | * @return void |
||
80 | */ |
||
81 | 4 | public function sort($direction = self::SORT_ASC) |
|
98 | |||
99 | 1 | public function matching(ConstraintInterface $constraint) |
|
108 | } |
||
109 |