CharsetMeta   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 32
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0
wmc 3
lcom 1
cbo 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A create() 0 3 1
A render() 0 3 1
A __construct() 0 3 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 20
    public static function create($charset) : MetaItem {
20 20
        return new self($charset);
21
    }
22
23
    /**
24
     * @return string
25
     */
26 16
    public function render(array $extra = []) : string {
27 16
        return "<meta charset=\"{$this->charset}\">";
28
    }
29
30
    /**
31
     * CharsetMeta constructor.
32
     *
33
     * @param string $charset
34
     */
35 20
    public function __construct(string $charset) {
36 20
        $this->charset = $charset;
37 20
    }
38
}
39