Subversion-Projekte lars-tiefland.laravel_shop

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
148 lars 1
<?php
2
 
3
declare(strict_types=1);
4
 
5
/*
6
 * This file is part of the league/commonmark package.
7
 *
8
 * (c) Colin O'Dell <colinodell@gmail.com>
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
 
14
namespace League\CommonMark\Parser;
15
 
16
/**
17
 * Encapsulates the current state of a cursor in case you need to rollback later.
18
 *
19
 * WARNING: Do not attempt to use this class for ANYTHING except for
20
 * type hinting and passing this object back into restoreState().
21
 * The constructor, methods, and inner contents may change in any
22
 * future release without warning!
23
 *
24
 * @internal
25
 *
26
 * @psalm-immutable
27
 */
28
final class CursorState
29
{
30
    /**
31
     * @var array<int, mixed>
32
     *
33
     * @psalm-readonly
34
     */
35
    private array $state;
36
 
37
    /**
38
     * @internal
39
     *
40
     * @param array<int, mixed> $state
41
     */
42
    public function __construct(array $state)
43
    {
44
        $this->state = $state;
45
    }
46
 
47
    /**
48
     * @internal
49
     *
50
     * @return array<int, mixed>
51
     */
52
    public function toArray(): array
53
    {
54
        return $this->state;
55
    }
56
}