1 | <?php |
||
23 | class ListBlock extends AbstractBlock |
||
24 | { |
||
25 | const TYPE_BULLET = 'bullet'; |
||
26 | const TYPE_ORDERED = 'ordered'; |
||
27 | |||
28 | /** |
||
29 | * @deprecated This constant is deprecated in league/commonmark 1.4 and will be removed in 2.0; use TYPE_BULLET instead |
||
30 | */ |
||
31 | const TYPE_UNORDERED = self::TYPE_BULLET; |
||
32 | |||
33 | /** |
||
34 | * @var bool |
||
35 | */ |
||
36 | protected $tight = false; |
||
37 | |||
38 | /** |
||
39 | * @var ListData |
||
40 | */ |
||
41 | protected $listData; |
||
42 | |||
43 | 360 | public function __construct(ListData $listData) |
|
47 | |||
48 | /** |
||
49 | * @return ListData |
||
50 | */ |
||
51 | 321 | public function getListData(): ListData |
|
55 | |||
56 | 153 | public function endsWithBlankLine(): bool |
|
57 | { |
||
58 | 153 | if ($this->lastLineBlank) { |
|
59 | 3 | return true; |
|
60 | } |
||
61 | |||
62 | 153 | if ($this->hasChildren()) { |
|
63 | 153 | return $this->lastChild() instanceof AbstractBlock && $this->lastChild()->endsWithBlankLine(); |
|
64 | } |
||
65 | |||
66 | return false; |
||
67 | } |
||
68 | |||
69 | 285 | public function canContain(AbstractBlock $block): bool |
|
73 | |||
74 | 144 | public function isCode(): bool |
|
78 | |||
79 | 225 | public function matchesNextLine(Cursor $cursor): bool |
|
83 | |||
84 | 267 | public function finalize(ContextInterface $context, int $endLineNumber) |
|
111 | |||
112 | 321 | public function isTight(): bool |
|
116 | |||
117 | 3 | public function setTight(bool $tight): self |
|
123 | } |
||
124 |