1 | <?php |
||
21 | class HtmlBlock extends AbstractBlock |
||
22 | { |
||
23 | const TYPE_1_CODE_CONTAINER = 1; |
||
24 | const TYPE_2_COMMENT = 2; |
||
25 | const TYPE_3 = 3; |
||
26 | const TYPE_4 = 4; |
||
27 | const TYPE_5_CDATA = 5; |
||
28 | const TYPE_6_BLOCK_ELEMENT = 6; |
||
29 | const TYPE_7_MISC_ELEMENT = 7; |
||
30 | |||
31 | /** |
||
32 | * @var int |
||
33 | */ |
||
34 | protected $type; |
||
35 | |||
36 | /** |
||
37 | * @param int $type |
||
38 | */ |
||
39 | 174 | public function __construct(int $type) |
|
45 | |||
46 | /** |
||
47 | * @return int |
||
48 | */ |
||
49 | public function getType(): int |
||
53 | |||
54 | /** |
||
55 | * @param int $type |
||
56 | */ |
||
57 | public function setType(int $type) |
||
61 | |||
62 | /** |
||
63 | * Returns true if this block can contain the given block as a child node |
||
64 | * |
||
65 | * @param AbstractBlock $block |
||
66 | * |
||
67 | * @return bool |
||
68 | */ |
||
69 | public function canContain(AbstractBlock $block): bool |
||
73 | |||
74 | /** |
||
75 | * Returns true if block type can accept lines of text |
||
76 | * |
||
77 | * @return bool |
||
78 | */ |
||
79 | 159 | public function acceptsLines(): bool |
|
83 | |||
84 | /** |
||
85 | * Whether this is a code block |
||
86 | * |
||
87 | * @return bool |
||
88 | */ |
||
89 | 111 | public function isCode(): bool |
|
93 | |||
94 | 129 | public function matchesNextLine(Cursor $cursor): bool |
|
102 | |||
103 | 159 | public function finalize(ContextInterface $context, int $endLineNumber) |
|
109 | |||
110 | /** |
||
111 | * @param ContextInterface $context |
||
112 | * @param Cursor $cursor |
||
113 | */ |
||
114 | 159 | public function handleRemainingContents(ContextInterface $context, Cursor $cursor) |
|
125 | } |
||
126 |