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

MetadataElement   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 7
c 0
b 0
f 0
dl 0
loc 19
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __toString() 0 3 1
A __construct() 0 4 1
A uniqueKey() 0 3 1
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