Completed
Push — refactor-parsing ( adbb6b...fbe6de )
by Colin
08:21 queued 07:01
created

CursorState::toArray()   A

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
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace League\CommonMark\Parser;
13
14
/**
15
 * Encapsulates the current state of a cursor in case you need to rollback later.
16
 *
17
 * WARNING: Do not attempt to use this class for ANYTHING except for
18
 * type hinting and passing this object back into restoreState().
19
 * The constructor, methods, and inner contents may change in any
20
 * future release without warning!
21
 *
22
 * @internal
23
 */
24
final class CursorState
25
{
26
    /**
27
     * @var array<int, mixed>
28
     */
29
    private $state;
30
31
    /**
32
     * @param array<int, mixed> $state
33
     *
34
     * @internal
35
     */
36 1686
    public function __construct(array $state)
37
    {
38 1686
        $this->state = $state;
39 1686
    }
40
41
    /**
42
     * @internal
43
     *
44
     * @return array<int, mixed>
0 ignored issues
show
Documentation introduced by
The doc-type array<int, could not be parsed: Expected ">" at position 5, but found "end of type". (view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
45
     */
46 1593
    public function toArray(): array
47
    {
48 1593
        return $this->state;
49
    }
50
}
51