AttributesInline   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Test Coverage

Coverage 80%

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 37
ccs 8
cts 10
cp 0.8
rs 10
c 0
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A setAttributes() 0 3 1
A isBlock() 0 3 1
A __construct() 0 6 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
    private array $attributes;
23
24
    private bool $block;
25
26
    /**
27
     * @param array<string, mixed> $attributes
28
     */
29 18
    public function __construct(array $attributes, bool $block)
30
    {
31 18
        parent::__construct();
32
33 18
        $this->attributes = $attributes;
34 18
        $this->block      = $block;
35
    }
36
37
    /**
38
     * @return array<string, mixed>
39
     */
40 18
    public function getAttributes(): array
41
    {
42 18
        return $this->attributes;
43
    }
44
45
    /**
46
     * @param array<string, mixed> $attributes
47
     */
48
    public function setAttributes(array $attributes): void
49
    {
50
        $this->attributes = $attributes;
51
    }
52
53 16
    public function isBlock(): bool
54
    {
55 16
        return $this->block;
56
    }
57
}
58