Completed
Pull Request — master (#8)
by
unknown
08:47
created

InlineAttributes   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 1
dl 0
loc 22
ccs 0
cts 14
cp 0
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
/*
4
 * This is part of the webuni/commonmark-attributes-extension package.
5
 *
6
 * (c) Martin Hasoň <[email protected]>
7
 * (c) Webuni s.r.o. <[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
namespace Webuni\CommonMark\AttributesExtension;
14
15
use League\CommonMark\Inline\Element\AbstractInline;
16
17
class InlineAttributes extends AbstractInline
18
{
19
    public $attributes;
20
    public $block;
21
22
    public function __construct(array $attributes, $block)
23
    {
24
        $this->attributes = $attributes;
25
        $this->block = (bool) $block;
26
        $this->data = ['delim' => true];
27
    }
28
29
    public function getAttributes()
30
    {
31
        return $this->attributes;
32
    }
33
34
    public function isBlock()
35
    {
36
        return (bool) $this->block;
37
    }
38
}
39