Passed
Push — master ( 80ddec...cae974 )
by Caen
03:33 queued 12s
created

MetadataItem   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 14
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 2 1
A uniqueKey() 0 3 1
A __toString() 0 3 1
1
<?php
2
3
namespace Hyde\Framework\Models\Metadata;
4
5
use Hyde\Framework\Contracts\MetadataItemContract;
6
7
class MetadataItem implements MetadataItemContract, \Stringable
8
{
9
    public function __construct(protected string $name, protected string $content)
10
    {
11
    }
12
13
    public function __toString(): string
14
    {
15
        return '<meta name="'.e($this->name).'" content="'.e($this->content).'">';
16
    }
17
18
    public function uniqueKey(): string
19
    {
20
        return $this->name;
21
    }
22
}
23