Completed
Push — master ( da0d4f...97e8b3 )
by Colin
03:00
created

Document   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 49
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 2
dl 0
loc 49
ccs 12
cts 12
cp 1
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getReferenceMap() 0 4 1
A canContain() 0 4 1
A isCode() 0 4 1
A matchesNextLine() 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
use League\CommonMark\Reference\ReferenceMap;
19
20
class Document extends AbstractBlock
21
{
22
    /***
23
     * @var ReferenceMap
24
     */
25
    protected $referenceMap;
26
27 2058
    public function __construct()
28
    {
29 2058
        $this->setStartLine(1);
30
31 2058
        $this->referenceMap = new ReferenceMap();
32 2058
    }
33
34
    /**
35
     * @return ReferenceMap
36
     */
37 2040
    public function getReferenceMap(): ReferenceMap
38
    {
39 2040
        return $this->referenceMap;
40
    }
41
42
    /**
43
     * Returns true if this block can contain the given block as a child node
44
     *
45
     * @param AbstractBlock $block
46
     *
47
     * @return bool
48
     */
49 2031
    public function canContain(AbstractBlock $block): bool
50
    {
51 2031
        return true;
52
    }
53
54
    /**
55
     * Whether this is a code block
56
     *
57
     * @return bool
58
     */
59 2031
    public function isCode(): bool
60
    {
61 2031
        return false;
62
    }
63
64 3
    public function matchesNextLine(Cursor $cursor): bool
65
    {
66 3
        return true;
67
    }
68
}
69