InlineParserContext   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 47
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 5
c 0
b 0
f 0
lcom 0
cbo 3
dl 0
loc 47
ccs 14
cts 14
cp 1
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A getContainer() 0 4 1
A getReferenceMap() 0 4 1
A getCursor() 0 4 1
A getDelimiterStack() 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;
16
17
use League\CommonMark\Block\Element\AbstractBlock;
18
use League\CommonMark\Delimiter\DelimiterStack;
19
use League\CommonMark\Reference\ReferenceMap;
20
21
class InlineParserContext
22
{
23
    private $container;
24
    private $referenceMap;
25
    private $cursor;
26
    private $delimiterStack;
27
28 1671
    public function __construct(AbstractBlock $container, ReferenceMap $referenceMap)
29
    {
30 1671
        $this->referenceMap = $referenceMap;
31 1671
        $this->container = $container;
32 1671
        $this->cursor = new Cursor(trim($container->getStringContent()));
33 1671
        $this->delimiterStack = new DelimiterStack();
34 1671
    }
35
36
    /**
37
     * @return AbstractBlock
38
     */
39 1215
    public function getContainer()
40
    {
41 1215
        return $this->container;
42
    }
43
44
    /**
45
     * @return ReferenceMap
46
     */
47 396
    public function getReferenceMap()
48
    {
49 396
        return $this->referenceMap;
50
    }
51
52
    /**
53
     * @return Cursor
54
     */
55 1671
    public function getCursor()
56
    {
57 1671
        return $this->cursor;
58
    }
59
60
    /**
61
     * @return DelimiterStack
62
     */
63 1662
    public function getDelimiterStack()
64
    {
65 1662
        return $this->delimiterStack;
66
    }
67
}
68