Total Complexity | 6 |
Total Lines | 34 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
14 | class Group extends Element implements Descriptionable |
||
15 | { |
||
16 | use Description; |
||
17 | use Container; |
||
18 | |||
19 | 11 | public function __construct(string $title = null, string $id = null) |
|
20 | { |
||
21 | 11 | parent::__construct($id ?? \uniqid('group'), $title); |
|
22 | } |
||
23 | |||
24 | 6 | public function add(array $elements = []): Group |
|
25 | { |
||
26 | 6 | foreach ($elements as $element) { |
|
27 | 6 | Assert::isInstanceOf($element, Element::class); |
|
28 | 5 | $element->setForm($this->getForm()); |
|
29 | 5 | $this->addElement($element); |
|
30 | } |
||
31 | 5 | return $this; |
|
32 | } |
||
33 | |||
34 | 3 | public function baseHtml(): string |
|
44 | } |
||
45 | |||
46 | public function prepare() |
||
48 | } |
||
49 | } |
||
50 |