Total Complexity | 5 |
Total Lines | 32 |
Duplicated Lines | 0 % |
Changes | 6 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
5 | class LinkElement extends BaseMetadataElement |
||
6 | { |
||
7 | protected string $rel; |
||
8 | protected string $href; |
||
9 | protected array $attr = []; |
||
10 | |||
11 | public function __construct(string $rel, string $href, array $attr = []) |
||
12 | { |
||
13 | $this->rel = $rel; |
||
14 | $this->href = $href; |
||
15 | $this->attr = $attr; |
||
16 | } |
||
17 | |||
18 | public function __toString(): string |
||
19 | { |
||
20 | return sprintf('<link rel="%s" href="%s"%s>', e($this->rel), e($this->href), $this->formatOptionalAttributes()); |
||
21 | } |
||
22 | |||
23 | public function uniqueKey(): string |
||
26 | } |
||
27 | |||
28 | protected function formatOptionalAttributes(): string |
||
37 | } |
||
38 | } |
||
39 |