| Total Complexity | 4 |
| Total Lines | 36 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 23 | class SlotContainer |
||
| 24 | { |
||
| 25 | /** |
||
| 26 | * @var Slot[] |
||
| 27 | */ |
||
| 28 | protected $slots = []; |
||
| 29 | |||
| 30 | /** |
||
| 31 | * @param Slot $slot |
||
| 32 | * |
||
| 33 | * @throws DuplicateEntryException |
||
| 34 | */ |
||
| 35 | public function add(Slot $slot) |
||
| 36 | { |
||
| 37 | if ($this->has($slot->getName())) { |
||
| 38 | throw DuplicateEntryException::slotContainerDuplication($slot->getName()); |
||
| 39 | } |
||
| 40 | |||
| 41 | $this->slots[$slot->getName()] = $slot; |
||
| 42 | } |
||
| 43 | |||
| 44 | /** |
||
| 45 | * @param string $name |
||
| 46 | * @return bool |
||
| 47 | */ |
||
| 48 | public function has(string $name): bool |
||
| 51 | } |
||
| 52 | |||
| 53 | /** |
||
| 54 | * @return Slot[] |
||
| 55 | */ |
||
| 56 | public function getList(): array |
||
| 61 |