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

Comment   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 24
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A render() 0 4 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