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
lcom 0
cbo 3
dl 0
loc 47
ccs 14
cts 14
cp 1
rs 10
c 0
b 0
f 0

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