AttributesInline   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Test Coverage

Coverage 75%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
eloc 9
dl 0
loc 38
ccs 9
cts 12
cp 0.75
rs 10
c 1
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A isBlock() 0 3 1
A __construct() 0 6 1
A setAttributes() 0 3 1
A getAttributes() 0 3 1
1
<?php
2
3
/*
4
 * This file is part of the league/commonmark package.
5
 *
6
 * (c) Colin O'Dell <[email protected]>
7
 * (c) 2015 Martin Hasoň <[email protected]>
8
 *
9
 * For the full copyright and license information, please view the LICENSE
10
 * file that was distributed with this source code.
11
 */
12
13
declare(strict_types=1);
14
15
namespace League\CommonMark\Extension\Attributes\Node;
16
17
use League\CommonMark\Node\Inline\AbstractInline;
18
19
final class AttributesInline extends AbstractInline
20
{
21
    /** @var array<string, mixed> */
22
    public $attributes;
23
24
    /** @var bool */
25
    public $block;
26
27
    /**
28
     * @param array<string, mixed> $attributes
29
     */
30 15
    public function __construct(array $attributes, bool $block)
31
    {
32 15
        parent::__construct();
33
34 15
        $this->attributes = $attributes;
35 15
        $this->block      = $block;
36 15
    }
37
38
    /**
39
     * @return array<string, mixed>
40
     */
41 15
    public function getAttributes(): array
42
    {
43 15
        return $this->attributes;
44
    }
45
46
    /**
47
     * @param array<string, mixed> $attributes
48
     */
49
    public function setAttributes(array $attributes): void
50
    {
51
        $this->attributes = $attributes;
52
    }
53
54 12
    public function isBlock(): bool
55
    {
56 12
        return $this->block;
57
    }
58
}
59