Total Complexity | 5 |
Total Lines | 24 |
Duplicated Lines | 0 % |
Changes | 4 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
5 | class OpenGraphElement extends BaseMetadataElement |
||
6 | { |
||
7 | protected string $property; |
||
8 | protected string $content; |
||
9 | |||
10 | public function __construct(string $property, string $content) |
||
11 | { |
||
12 | $this->property = $this->normalizeProperty($property); |
||
13 | $this->content = $content; |
||
14 | } |
||
15 | |||
16 | public function __toString(): string |
||
17 | { |
||
18 | return sprintf('<meta property="og:%s" content="%s">', e($this->property), e($this->content)); |
||
19 | } |
||
20 | |||
21 | public function uniqueKey(): string |
||
24 | } |
||
25 | |||
26 | protected function normalizeProperty(string $property): string |
||
29 | } |
||
30 | } |
||
31 |