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
 * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js)
11
 *  - (c) John MacFarlane
12
 *
13
 * For the full copyright and license information, please view the LICENSE
14
 * file that was distributed with this source code.
15
 */
16
 
17
namespace League\CommonMark\Extension\CommonMark\Node\Block;
18
 
19
use League\CommonMark\Node\Block\AbstractBlock;
20
use League\CommonMark\Node\StringContainerInterface;
21
 
22
final class FencedCode extends AbstractBlock implements StringContainerInterface
23
{
24
    private ?string $info = null;
25
 
26
    private string $literal = '';
27
 
28
    private int $length;
29
 
30
    private string $char;
31
 
32
    private int $offset;
33
 
34
    public function __construct(int $length, string $char, int $offset)
35
    {
36
        parent::__construct();
37
 
38
        $this->length = $length;
39
        $this->char   = $char;
40
        $this->offset = $offset;
41
    }
42
 
43
    public function getInfo(): ?string
44
    {
45
        return $this->info;
46
    }
47
 
48
    /**
49
     * @return string[]
50
     */
51
    public function getInfoWords(): array
52
    {
53
        return \preg_split('/\s+/', $this->info ?? '') ?: [];
54
    }
55
 
56
    public function setInfo(string $info): void
57
    {
58
        $this->info = $info;
59
    }
60
 
61
    public function getLiteral(): string
62
    {
63
        return $this->literal;
64
    }
65
 
66
    public function setLiteral(string $literal): void
67
    {
68
        $this->literal = $literal;
69
    }
70
 
71
    public function getChar(): string
72
    {
73
        return $this->char;
74
    }
75
 
76
    public function setChar(string $char): void
77
    {
78
        $this->char = $char;
79
    }
80
 
81
    public function getLength(): int
82
    {
83
        return $this->length;
84
    }
85
 
86
    public function setLength(int $length): void
87
    {
88
        $this->length = $length;
89
    }
90
 
91
    public function getOffset(): int
92
    {
93
        return $this->offset;
94
    }
95
 
96
    public function setOffset(int $offset): void
97
    {
98
        $this->offset = $offset;
99
    }
100
}