Completed
Push — master ( 509144...34378c )
by Martin
07:36
created

Attributes::isCode()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 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\Block\Element\AbstractBlock;
16
use League\CommonMark\ContextInterface;
17
use League\CommonMark\Cursor;
18
19
class Attributes extends AbstractBlock
20
{
21
    private $attributes;
22
23 5
    public function __construct($attributes)
24
    {
25 5
        parent::__construct();
26 5
        $this->attributes = $attributes;
27 5
    }
28
29 5
    public function getAttributes()
30
    {
31 5
        return $this->attributes;
32
    }
33
34
    public function canContain(AbstractBlock $block)
35
    {
36
        return false;
37
    }
38
39 5
    public function acceptsLines()
40
    {
41 5
        return false;
42
    }
43
44 5
    public function isCode()
45
    {
46 5
        return false;
47
    }
48
49 4
    public function matchesNextLine(Cursor $cursor)
50
    {
51 4
        if ($cursor->isBlank()) {
52 3
            $this->setLastLineBlank(true);
53
        } else {
54 3
            $this->setLastLineBlank(false);
55
        }
56
57 4
        return false;
58
    }
59
60 5
    public function shouldLastLineBeBlank(Cursor $cursor, $currentLineNumber)
61
    {
62 5
        return false;
63
    }
64
65
    public function handleRemainingContents(ContextInterface $context, Cursor $cursor)
66
    {
67
    }
68
}
69