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\Extension\CommonMark\Node\Block;
15
 
16
use League\CommonMark\Node\Block\AbstractBlock;
17
use League\CommonMark\Node\RawMarkupContainerInterface;
18
 
19
final class HtmlBlock extends AbstractBlock implements RawMarkupContainerInterface
20
{
21
    // Any changes to these constants should be reflected in .phpstorm.meta.php
22
    public const TYPE_1_CODE_CONTAINER = 1;
23
    public const TYPE_2_COMMENT        = 2;
24
    public const TYPE_3                = 3;
25
    public const TYPE_4                = 4;
26
    public const TYPE_5_CDATA          = 5;
27
    public const TYPE_6_BLOCK_ELEMENT  = 6;
28
    public const TYPE_7_MISC_ELEMENT   = 7;
29
 
30
    /**
31
     * @psalm-var self::TYPE_* $type
32
     * @phpstan-var self::TYPE_* $type
33
     */
34
    private int $type;
35
 
36
    private string $literal = '';
37
 
38
    /**
39
     * @psalm-param self::TYPE_* $type
40
     *
41
     * @phpstan-param self::TYPE_* $type
42
     */
43
    public function __construct(int $type)
44
    {
45
        parent::__construct();
46
 
47
        $this->type = $type;
48
    }
49
 
50
    /**
51
     * @psalm-return self::TYPE_*
52
     *
53
     * @phpstan-return self::TYPE_*
54
     */
55
    public function getType(): int
56
    {
57
        return $this->type;
58
    }
59
 
60
    /**
61
     * @psalm-param self::TYPE_* $type
62
     *
63
     * @phpstan-param self::TYPE_* $type
64
     */
65
    public function setType(int $type): void
66
    {
67
        $this->type = $type;
68
    }
69
 
70
    public function getLiteral(): string
71
    {
72
        return $this->literal;
73
    }
74
 
75
    public function setLiteral(string $literal): void
76
    {
77
        $this->literal = $literal;
78
    }
79
}