| Total Complexity | 3 |
| Total Lines | 55 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 19 | class Style extends AbstractSeries |
||
| 20 | { |
||
| 21 | |||
| 22 | /** |
||
| 23 | * Add an element to the list |
||
| 24 | * |
||
| 25 | * @param string $href |
||
| 26 | * @param array $attributes |
||
| 27 | * |
||
| 28 | * @return $this |
||
| 29 | * @throws Exception |
||
| 30 | */ |
||
| 31 | 2 | public function add(string $href, array $attributes = []) |
|
| 32 | { |
||
| 33 | 2 | $this->store[] = [ |
|
| 34 | 2 | "renderFullElement", |
|
| 35 | [ |
||
| 36 | 2 | $this->getTag(), |
|
| 37 | 2 | '', |
|
| 38 | 2 | $this->getAttributes($href, $attributes), |
|
| 39 | ], |
||
| 40 | 2 | $this->indent(), |
|
| 41 | ]; |
||
| 42 | |||
| 43 | 2 | return $this; |
|
| 44 | } |
||
| 45 | |||
| 46 | /** |
||
| 47 | * @return string |
||
| 48 | */ |
||
| 49 | 1 | protected function getTag(): string |
|
| 50 | { |
||
| 51 | 1 | return 'style'; |
|
| 52 | } |
||
| 53 | |||
| 54 | /** |
||
| 55 | * Returns the necessary attributes |
||
| 56 | * |
||
| 57 | * @param string $href |
||
| 58 | * @param array $attributes |
||
| 59 | * |
||
| 60 | * @return array |
||
| 61 | */ |
||
| 62 | 1 | protected function getAttributes(string $href, array $attributes): array |
|
| 74 | } |
||
| 75 | } |
||
| 76 |