Total Complexity | 6 |
Total Lines | 68 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
12 | class AttributeNode extends NaryNode implements AttributeNodeInterface |
||
13 | { |
||
14 | /** |
||
15 | * @var array |
||
16 | */ |
||
17 | private $attributes = []; |
||
18 | |||
19 | /** |
||
20 | * ValueNode constructor. |
||
21 | * |
||
22 | * @param array<int|string, mixed> $attributes |
||
23 | * @param int|null $capacity |
||
24 | * @param TraverserInterface|null $traverser |
||
25 | * @param NodeInterface|null $parent |
||
26 | */ |
||
27 | 10 | public function __construct( |
|
36 | 10 | } |
|
37 | |||
38 | /** |
||
39 | * {@inheritdoc} |
||
40 | */ |
||
41 | 4 | public function getAttribute(string $key) |
|
44 | } |
||
45 | |||
46 | /** |
||
47 | * {@inheritdoc} |
||
48 | */ |
||
49 | 4 | public function getAttributes(): array |
|
52 | } |
||
53 | |||
54 | /** |
||
55 | * {@inheritdoc} |
||
56 | */ |
||
57 | 2 | public function label(): string |
|
58 | { |
||
59 | 2 | return (string) $this->getAttribute('label'); |
|
60 | } |
||
61 | |||
62 | /** |
||
63 | * {@inheritdoc} |
||
64 | */ |
||
65 | 2 | public function setAttribute(string $key, $value): AttributeNodeInterface |
|
70 | } |
||
71 | |||
72 | /** |
||
73 | * {@inheritdoc} |
||
74 | */ |
||
75 | 1 | public function setAttributes(array $attributes): AttributeNodeInterface |
|
80 | } |
||
81 | } |
||
82 |