Document   A
last analyzed

Coupling/Cohesion

Components 0
Dependencies 2

Complexity

Total Complexity 6

Size/Duplication

Total Lines 61
Duplicated Lines 0 %

Test Coverage

Coverage 86.67%

Importance

Changes 0
Metric Value
wmc 6
c 0
b 0
f 0
lcom 0
cbo 2
dl 0
loc 61
ccs 13
cts 15
cp 0.8667
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 1
A getReferenceMap() 0 4 1
A canContain() 0 4 1
A acceptsLines() 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 1941
    public function __construct()
28
    {
29 1941
        parent::__construct();
30
31 1941
        $this->setStartLine(1);
32
33 1941
        $this->referenceMap = new ReferenceMap();
34 1941
    }
35
36
    /**
37
     * @return ReferenceMap
38
     */
39 1935
    public function getReferenceMap()
40
    {
41 1935
        return $this->referenceMap;
42
    }
43
44
    /**
45
     * Returns true if this block can contain the given block as a child node
46
     *
47
     * @param AbstractBlock $block
48
     *
49
     * @return bool
50
     */
51 1932
    public function canContain(AbstractBlock $block)
52
    {
53 1932
        return true;
54
    }
55
56
    /**
57
     * Returns true if block type can accept lines of text
58
     *
59
     * @return bool
60
     */
61 1377
    public function acceptsLines()
62
    {
63 1377
        return false;
64
    }
65
66
    /**
67
     * Whether this is a code block
68
     *
69
     * @return bool
70
     */
71 1932
    public function isCode()
72
    {
73 1932
        return false;
74
    }
75
76
    public function matchesNextLine(Cursor $cursor)
77
    {
78
        return true;
79
    }
80
}
81