| Total Complexity | 9 |
| Total Lines | 46 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 13 | abstract class AvailableMigrations implements Countable |
||
| 14 | { |
||
| 15 | /** @var AvailableMigration[] */ |
||
| 16 | protected $items = []; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * @param AvailableMigration[] $items |
||
| 20 | */ |
||
| 21 | 90 | public function __construct(array $items) |
|
| 22 | { |
||
| 23 | 90 | $this->items = array_values($items); |
|
| 24 | 90 | } |
|
| 25 | |||
| 26 | /** |
||
| 27 | * @return AvailableMigration[] |
||
| 28 | */ |
||
| 29 | 71 | public function getItems() : array |
|
| 30 | { |
||
| 31 | 71 | return $this->items; |
|
| 32 | } |
||
| 33 | |||
| 34 | 19 | public function count() : int |
|
| 35 | { |
||
| 36 | 19 | return count($this->items); |
|
| 37 | } |
||
| 38 | |||
| 39 | 25 | public function hasMigration(Version $version) : bool |
|
| 48 | } |
||
| 49 | |||
| 50 | 8 | public function getMigration(Version $version) : AvailableMigration |
|
| 59 | } |
||
| 60 | } |
||
| 61 |