Passed
Branch v2 (aaaa8e)
by Brent
03:38
created

CharsetMeta::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace Pageon\Html\Meta\Item;
4
5
use Pageon\Html\Meta\MetaItem;
6
7
final class CharsetMeta implements MetaItem
8
{
9
    /**
10
     * @var string
11
     */
12
    private $charset;
13
14
    /**
15
     * @param string $charset
16
     *
17
     * @return MetaItem
18
     */
19
    public static function create($charset) : MetaItem {
20
        return new self($charset);
21
    }
22
23
    /**
24
     * @return string
25
     */
26
    public function render() : string {
27
        return "<meta charset=\"{$this->charset}\">";
28
    }
29
30
    /**
31
     * CharsetMeta constructor.
32
     *
33
     * @param string $charset
34
     */
35
    public function __construct(string $charset) {
36
        $this->charset = $charset;
37
    }
38
}
39