Attributes::isCode()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 1
cts 1
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 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\Block\Element\AbstractBlock;
18
use League\CommonMark\ContextInterface;
19
use League\CommonMark\Cursor;
20
21
final class Attributes extends AbstractBlock
22
{
23 5
    private $attributes;
24
25 5
    public function __construct(array $attributes)
26 5
    {
27 5
        $this->attributes = $attributes;
28
    }
29 5
30
    public function getAttributes(): array
31 5
    {
32
        return $this->attributes;
33
    }
34
35
    public function canContain(AbstractBlock $block): bool
36
    {
37
        return false;
38
    }
39 5
40
    public function isCode(): bool
41 5
    {
42
        return false;
43
    }
44 5
45
    public function matchesNextLine(Cursor $cursor): bool
46 5
    {
47
        if ($cursor->isBlank()) {
48
            $this->setLastLineBlank(true);
49 4
        } else {
50
            $this->setLastLineBlank(false);
51 4
        }
52 3
53
        return false;
54 3
    }
55
56
    public function shouldLastLineBeBlank(Cursor $cursor, int $currentLineNumber): bool
57 4
    {
58
        return false;
59
    }
60 5
61
    public function handleRemainingContents(ContextInterface $context, Cursor $cursor): void
0 ignored issues
show
Unused Code introduced by
The parameter $context is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $cursor is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
62 5
    {
63
    }
64
}
65