AttributesInline   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 1
dl 0
loc 23
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getAttributes() 0 4 1
A isBlock() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This is part of the webuni/commonmark-attributes-extension package.
7
 *
8
 * (c) Martin Hasoň <[email protected]>
9
 * (c) Webuni s.r.o. <[email protected]>
10
 *
11
 * For the full copyright and license information, please view the LICENSE
12
 * file that was distributed with this source code.
13
 */
14
15
namespace Webuni\CommonMark\AttributesExtension;
16
17
use League\CommonMark\Inline\Element\AbstractInline;
18
19
final class AttributesInline extends AbstractInline
20
{
21
    public $attributes;
22
23
    public $block;
24
25
    public function __construct(array $attributes, bool $block)
26
    {
27
        $this->attributes = $attributes;
28
        $this->block = $block;
29
        $this->data = ['delim' => true];
30
    }
31
32
    public function getAttributes(): array
33
    {
34
        return $this->attributes;
35
    }
36
37
    public function isBlock(): bool
38
    {
39
        return (bool) $this->block;
40
    }
41
}
42