Attributes   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 5
eloc 11
dl 0
loc 44
ccs 12
cts 12
cp 1
rs 10
c 1
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getAttributes() 0 3 1
A setTarget() 0 3 1
A setAttributes() 0 3 1
A getTarget() 0 3 1
A __construct() 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\Block\AbstractBlock;
18
19
final class Attributes extends AbstractBlock
20
{
21
    public const TARGET_PARENT   = 0;
22
    public const TARGET_PREVIOUS = 1;
23
    public const TARGET_NEXT     = 2;
24
25
    /** @var array<string, mixed> */
26
    private $attributes;
27
28
    /** @var int */
29
    private $target = self::TARGET_NEXT;
30
31
    /**
32
     * @param array<string, mixed> $attributes
33
     */
34 15
    public function __construct(array $attributes)
35
    {
36 15
        $this->attributes = $attributes;
37 15
    }
38
39
    /**
40
     * @return array<string, mixed>
41
     */
42 15
    public function getAttributes(): array
43
    {
44 15
        return $this->attributes;
45
    }
46
47
    /**
48
     * @param array<string, mixed> $attributes
49
     */
50 3
    public function setAttributes(array $attributes): void
51
    {
52 3
        $this->attributes = $attributes;
53 3
    }
54
55 15
    public function getTarget(): int
56
    {
57 15
        return $this->target;
58
    }
59
60 12
    public function setTarget(int $target): void
61
    {
62 12
        $this->target = $target;
63 12
    }
64
}
65