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