Test Failed
Push — master ( f2bdc0...e2cac0 )
by Chris
29:08
created

HtmlElement::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 3
nc 2
nop 2
dl 0
loc 6
rs 10
c 1
b 0
f 0
1
<?php
2
3
namespace WebTheory\Html;
4
5
class HtmlElement extends AbstractHtmlElement
6
{
7
    /**
8
     *
9
     */
10
    protected $tag;
11
12
    /**
13
     *
14
     */
15
    protected $innerHtml = '';
16
17
    /**
18
     *
19
     */
20
    public function __construct(string $tag, ?string $innerHtml = null)
21
    {
22
        $this->tag = $tag;
23
        $innerHtml && $this->innerHtml = $innerHtml;
24
25
        parent::__construct();
26
    }
27
28
    /**
29
     * Get the value of tag
30
     *
31
     * @return mixed
32
     */
33
    public function getTag()
34
    {
35
        return $this->tag;
36
    }
37
38
    /**
39
     * Get the value of innerHtml
40
     *
41
     * @return mixed
42
     */
43
    public function getInnerHtml()
44
    {
45
        return $this->innerHtml;
46
    }
47
48
    /**
49
     *
50
     */
51
    protected function renderHtmlMarkup(): string
52
    {
53
        return $this->tag($this->tag, $this->attributes, $this->innerHtml);
54
    }
55
}
56