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

InlineAttributes::isBlock()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

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