Completed
Push — master ( 103c69...214519 )
by Colin
35:28 queued 34:02
created

FootnoteParser::isContainer()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

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
nc 1
nop 0
crap 1
1
<?php
2
3
/*
4
 * This file is part of the league/commonmark package.
5
 *
6
 * (c) Colin O'Dell <[email protected]>
7
 * (c) Rezo Zero / Ambroise Maupate
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
declare(strict_types=1);
14
15
namespace League\CommonMark\Extension\Footnote\Parser;
16
17
use League\CommonMark\Extension\Footnote\Node\Footnote;
18
use League\CommonMark\Node\Block\AbstractBlock;
19
use League\CommonMark\Parser\Block\AbstractBlockContinueParser;
20
use League\CommonMark\Parser\Block\BlockContinue;
21
use League\CommonMark\Parser\Block\BlockContinueParserInterface;
22
use League\CommonMark\Parser\Cursor;
23
use League\CommonMark\Reference\ReferenceInterface;
24
25
final class FootnoteParser extends AbstractBlockContinueParser
26
{
27
    /**
28
     * @var Footnote
29
     *
30
     * @psalm-readonly
31
     */
32
    private $block;
33
34 18
    public function __construct(ReferenceInterface $reference)
35
    {
36 18
        $this->block = new Footnote($reference);
37 18
    }
38
39 18
    public function getBlock(): AbstractBlock
40
    {
41 18
        return $this->block;
42
    }
43
44 12
    public function tryContinue(Cursor $cursor, BlockContinueParserInterface $activeBlockParser): ?BlockContinue
45
    {
46 12
        return BlockContinue::none();
47
    }
48
49 18
    public function isContainer(): bool
50
    {
51 18
        return true;
52
    }
53
54 18
    public function canContain(AbstractBlock $childBlock): bool
55
    {
56 18
        return true;
57
    }
58
}
59