Test Failed
Push — master ( 22b809...326de4 )
by Brent
05:15 queued 39s
created

HttpEquivMeta   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 40
ccs 8
cts 8
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 4 1
1
<?php
2
3
namespace Pageon\Html\Meta\Item;
4
5
use Pageon\Html\Meta\MetaItem;
6
7
final class HttpEquivMeta implements MetaItem
8
{
9
    /**
10
     * @var string
11
     */
12
    private $httpEquiv;
13
14
    /**
15
     * @var string
16
     */
17
    private $content;
18
19
    /**
20
     * @param string $httpEquiv
21
     * @param string $content
22
     *
23
     * @return MetaItem
24
     */
25 2
    public static function create(string $httpEquiv, string $content) : MetaItem {
26 2
        return new self($httpEquiv, $content);
27
    }
28
29
    /**
30
     * @return string
31
     */
32 1
    public function render(array $extra = []) : string {
33 1
        return "<meta http-equiv=\"{$this->httpEquiv}\" content=\"{$this->content}\">";
34
    }
35
36
    /**
37
     * HttpEquivMeta constructor.
38
     *
39
     * @param string $httpEquiv
40
     * @param string $content
41
     */
42 2
    public function __construct(string $httpEquiv, string $content) {
43 2
        $this->httpEquiv = $httpEquiv;
44 2
        $this->content = $content;
45 2
    }
46
}
47