Completed
Push — master ( 9eb60a...7a0a03 )
by Colin
36:39 queued 35:14
created

BlockQuote::matchesNextLine()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 12

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 12

Importance

Changes 0
Metric Value
dl 0
loc 12
ccs 0
cts 7
cp 0
rs 9.8666
c 0
b 0
f 0
cc 3
nc 2
nop 1
crap 12
1
<?php
2
3
/*
4
 * This file is part of the league/commonmark package.
5
 *
6
 * (c) Colin O'Dell <[email protected]>
7
 *
8
 * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js)
9
 *  - (c) John MacFarlane
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 League\CommonMark\Extension\CommonMark\Node\Block;
16
17
use League\CommonMark\Node\Block\AbstractBlock;
18
use League\CommonMark\Parser\Cursor;
19
20
/**
21
 * @method children() AbstractBlock[]
22
 */
23
class BlockQuote extends AbstractBlock
24
{
25
    public function canContain(AbstractBlock $block): bool
26
    {
27
        return true;
28
    }
29
30
    public function isCode(): bool
31
    {
32
        return false;
33
    }
34
35
    public function matchesNextLine(Cursor $cursor): bool
36
    {
37
        if (!$cursor->isIndented() && $cursor->getNextNonSpaceCharacter() === '>') {
38
            $cursor->advanceToNextNonSpaceOrTab();
39
            $cursor->advanceBy(1);
40
            $cursor->advanceBySpaceOrTab();
41
42
            return true;
43
        }
44
45
        return false;
46
    }
47
48
    public function shouldLastLineBeBlank(Cursor $cursor, int $currentLineNumber): bool
49
    {
50
        return false;
51
    }
52
}
53