InlineParserContext::getContainer()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 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\ReferenceMapInterface;
21
22
class InlineParserContext
23
{
24
    private $container;
25
    private $referenceMap;
26
    private $cursor;
27
    private $delimiterStack;
28
29 2031
    public function __construct(AbstractStringContainerBlock $container, ReferenceMapInterface $referenceMap)
30
    {
31 2031
        $this->referenceMap = $referenceMap;
32 2031
        $this->container = $container;
33 2031
        $this->cursor = new Cursor(\trim($container->getStringContent()));
34 2031
        $this->delimiterStack = new DelimiterStack();
35 2031
    }
36
37
    /**
38
     * @return AbstractBlock
39
     */
40 1554
    public function getContainer(): AbstractBlock
41
    {
42 1554
        return $this->container;
43
    }
44
45
    /**
46
     * @return ReferenceMapInterface
47
     */
48 423
    public function getReferenceMap(): ReferenceMapInterface
49
    {
50 423
        return $this->referenceMap;
51
    }
52
53
    /**
54
     * @return Cursor
55
     */
56 2031
    public function getCursor(): Cursor
57
    {
58 2031
        return $this->cursor;
59
    }
60
61
    /**
62
     * @return DelimiterStack
63
     */
64 2022
    public function getDelimiterStack(): DelimiterStack
65
    {
66 2022
        return $this->delimiterStack;
67
    }
68
}
69