BlockQuote   A
last analyzed

Coupling/Cohesion

Components 0
Dependencies 2

Complexity

Total Complexity 7

Size/Duplication

Total Lines 58
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 7
lcom 0
cbo 2
dl 0
loc 58
ccs 15
cts 15
cp 1
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A canContain() 0 4 1
A acceptsLines() 0 4 1
A isCode() 0 4 1
A matchesNextLine() 0 12 3
A shouldLastLineBeBlank() 0 4 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 129
    public function canContain(AbstractBlock $block)
29
    {
30 129
        return true;
31
    }
32
33
    /**
34
     * Returns true if block type can accept lines of text
35
     *
36
     * @return bool
37
     */
38 135
    public function acceptsLines()
39
    {
40 135
        return false;
41
    }
42
43
    /**
44
     * Whether this is a code block
45
     *
46
     * @return bool
47
     */
48 135
    public function isCode()
49
    {
50 135
        return false;
51
    }
52
53 99
    public function matchesNextLine(Cursor $cursor)
54
    {
55 99
        if (!$cursor->isIndented() && $cursor->getNextNonSpaceCharacter() === '>') {
56 51
            $cursor->advanceToNextNonSpaceOrTab();
57 51
            $cursor->advance();
58 51
            $cursor->advanceBySpaceOrTab();
59
60 51
            return true;
61
        }
62
63 66
        return false;
64
    }
65
66
    /**
67
     * @param Cursor $cursor
68
     * @param int    $currentLineNumber
69
     *
70
     * @return bool
71
     */
72 111
    public function shouldLastLineBeBlank(Cursor $cursor, $currentLineNumber)
73
    {
74 111
        return false;
75
    }
76
}
77