Completed
Push — master ( aeeeb2...74d969 )
by Colin
03:28
created

BlockQuote::acceptsLines()   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
 *
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\Block\Element;
16
17
use League\CommonMark\Cursor;
18
19
class BlockQuote extends AbstractBlock
20
{
21
    /**
22
     * Returns true if this block can contain the given block as a child node
23
     *
24
     * @param AbstractBlock $block
25
     *
26
     * @return bool
27
     */
28 135
    public function canContain(AbstractBlock $block): bool
29
    {
30 135
        return true;
31
    }
32
33
    /**
34
     * Whether this is a code block
35
     *
36
     * @return bool
37
     */
38 141
    public function isCode(): bool
39
    {
40 141
        return false;
41
    }
42
43 99
    public function matchesNextLine(Cursor $cursor): bool
44
    {
45 99
        if (!$cursor->isIndented() && $cursor->getNextNonSpaceCharacter() === '>') {
46 51
            $cursor->advanceToNextNonSpaceOrTab();
47 51
            $cursor->advance();
48 51
            $cursor->advanceBySpaceOrTab();
49
50 51
            return true;
51
        }
52
53 66
        return false;
54
    }
55
56
    /**
57
     * @param Cursor $cursor
58
     * @param int    $currentLineNumber
59
     *
60
     * @return bool
61
     */
62 117
    public function shouldLastLineBeBlank(Cursor $cursor, int $currentLineNumber): bool
63
    {
64 117
        return false;
65
    }
66
}
67