Passed
Push — master ( 9e7cad...7929d2 )
by Caen
03:29 queued 12s
created

MetadataElement::__toString()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
namespace Hyde\Framework\Modules\Metadata\Models;
4
5
class MetadataElement extends BaseMetadataElement
6
{
7
    protected string $name;
8
    protected string $content;
9
10
    public function __construct(string $name, string $content)
11
    {
12
        $this->name = $name;
13
        $this->content = $content;
14
    }
15
16
    public function __toString(): string
17
    {
18
        return sprintf('<meta name="%s" content="%s">', e($this->name), e($this->content));
19
    }
20
21
    public function uniqueKey(): string
22
    {
23
        return $this->name;
24
    }
25
}
26