Completed
Push — master ( d4e957...308746 )
by Pol
02:55
created

Comment::render()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
namespace drupol\htmltag\Tag;
4
5
use drupol\htmltag\Attributes\AttributesFactory;
6
use drupol\htmltag\Attributes\AttributesInterface;
7
8
/**
9
 * Class Comment.
10
 */
11
class Comment extends Tag
12
{
13
    /**
14
     * Comment constructor.
15
     *
16
     * @param mixed $content
17
     *   The comment content.
18
     */
19 3
    public function __construct(
20
        $content = null
21
    ) {
22 3
        $attributes = AttributesFactory::build();
23
24 3
        parent::__construct($attributes, 'comment', $content);
25 3
    }
26
27
    /**
28
     * {@inheritdoc}
29
     */
30 2
    public function render()
31
    {
32 2
        return \sprintf('<!--%s-->', $this->renderContent());
33
    }
34
}
35