AttributesInline::getAttributes()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
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