ListBlock::setTight()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
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 <[email protected]>
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\Block\TightBlockInterface;
21
22
class ListBlock extends AbstractBlock implements TightBlockInterface
23
{
24
    public const TYPE_BULLET  = 'bullet';
25
    public const TYPE_ORDERED = 'ordered';
26
27
    /** @var bool */
28
    protected $tight = false;
29
30
    /**
31
     * @var ListData
32
     *
33
     * @psalm-readonly
34
     */
35
    protected $listData;
36
37 360
    public function __construct(ListData $listData)
38
    {
39 360
        parent::__construct();
40
41 360
        $this->listData = $listData;
42 360
    }
43
44 354
    public function getListData(): ListData
45
    {
46 354
        return $this->listData;
47
    }
48
49 264
    public function isTight(): bool
50
    {
51 264
        return $this->tight;
52
    }
53
54 297
    public function setTight(bool $tight): void
55
    {
56 297
        $this->tight = $tight;
57 297
    }
58
}
59