HtmlBlock   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 5
eloc 16
dl 0
loc 42
ccs 13
cts 13
cp 1
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getType() 0 3 1
A setLiteral() 0 3 1
A getLiteral() 0 3 1
A setType() 0 3 1
A __construct() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the league/commonmark package.
7
 *
8
 * (c) Colin O'Dell <[email protected]>
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace League\CommonMark\Extension\CommonMark\Node\Block;
15
16
use League\CommonMark\Node\Block\AbstractBlock;
17
use League\CommonMark\Node\StringContainerInterface;
18
19
class HtmlBlock extends AbstractBlock implements StringContainerInterface
20
{
21
    // Any changes to these constants should be reflected in .phpstorm.meta.php
22
    public const TYPE_1_CODE_CONTAINER = 1;
23
    public const TYPE_2_COMMENT        = 2;
24
    public const TYPE_3                = 3;
25
    public const TYPE_4                = 4;
26
    public const TYPE_5_CDATA          = 5;
27
    public const TYPE_6_BLOCK_ELEMENT  = 6;
28
    public const TYPE_7_MISC_ELEMENT   = 7;
29
30
    /** @var int */
31
    protected $type;
32
33
    /** @var string */
34
    protected $literal = '';
35
36 192
    public function __construct(int $type)
37
    {
38 192
        parent::__construct();
39
40 192
        $this->type = $type;
41 192
    }
42
43 177
    public function getType(): int
44
    {
45 177
        return $this->type;
46
    }
47
48 3
    public function setType(int $type): void
49
    {
50 3
        $this->type = $type;
51 3
    }
52
53 186
    public function getLiteral(): string
54
    {
55 186
        return $this->literal;
56
    }
57
58 186
    public function setLiteral(string $literal): void
59
    {
60 186
        $this->literal = $literal;
61 186
    }
62
}
63