Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
7 / 7 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
| SegmentDisplay | |
100.00% |
7 / 7 |
|
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
7 / 7 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | namespace Apie\HtmlBuilders\Components\Resource\FieldDisplay; |
| 3 | |
| 4 | use Apie\HtmlBuilders\Components\BaseComponent; |
| 5 | use Apie\HtmlBuilders\Interfaces\ComponentInterface; |
| 6 | use Apie\HtmlBuilders\Lists\ComponentHashmap; |
| 7 | |
| 8 | class SegmentDisplay extends BaseComponent |
| 9 | { |
| 10 | /** |
| 11 | * @param array<string|int, ComponentInterface> $detailComponents |
| 12 | */ |
| 13 | public function __construct(array $detailComponents, bool $showKeys = true) |
| 14 | { |
| 15 | parent::__construct( |
| 16 | [ |
| 17 | 'componentNames' => array_keys($detailComponents), |
| 18 | 'showKeys' => $showKeys, |
| 19 | ], |
| 20 | new ComponentHashmap($detailComponents) |
| 21 | ); |
| 22 | } |
| 23 | } |