| Total Complexity | 3 |
| Total Lines | 53 |
| 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 | 4 | public function add(string $href, array $attributes = []) |
|
| 32 | { |
||
| 33 | 4 | $this->store[] = $this->indent |
|
| 34 | 4 | . $this->renderFullElement( |
|
| 35 | 4 | $this->getTag(), |
|
| 36 | 4 | '', |
|
| 37 | 4 | $this->getAttributes($href, $attributes) |
|
| 38 | ) |
||
| 39 | ; |
||
| 40 | |||
| 41 | 4 | return $this; |
|
| 42 | } |
||
| 43 | |||
| 44 | /** |
||
| 45 | * @return string |
||
| 46 | */ |
||
| 47 | 2 | protected function getTag(): string |
|
| 48 | { |
||
| 49 | 2 | return 'style'; |
|
| 50 | } |
||
| 51 | |||
| 52 | /** |
||
| 53 | * Returns the necessary attributes |
||
| 54 | * |
||
| 55 | * @param string $attribute |
||
| 56 | * @param array $attributes |
||
| 57 | * |
||
| 58 | * @return array |
||
| 59 | */ |
||
| 60 | 2 | protected function getAttributes(string $attribute, array $attributes): array |
|
| 72 | } |
||
| 73 | } |
||
| 74 |