1 | <?php |
||
20 | class Heading extends AbstractBlock implements InlineContainer |
||
21 | { |
||
22 | /** |
||
23 | * @var int |
||
24 | */ |
||
25 | protected $level; |
||
26 | |||
27 | /** |
||
28 | * @param int $level |
||
29 | * @param string $contents |
||
30 | */ |
||
31 | 123 | public function __construct($level, $contents) |
|
38 | |||
39 | /** |
||
40 | * @return int |
||
41 | */ |
||
42 | 123 | public function getLevel() |
|
46 | |||
47 | 105 | public function finalize(ContextInterface $context, $endLineNumber) |
|
53 | |||
54 | /** |
||
55 | * Returns true if this block can contain the given block as a child node |
||
56 | * |
||
57 | * @param AbstractBlock $block |
||
58 | * |
||
59 | * @return bool |
||
60 | */ |
||
61 | public function canContain(AbstractBlock $block) |
||
65 | |||
66 | /** |
||
67 | * Returns true if block type can accept lines of text |
||
68 | * |
||
69 | * @return bool |
||
70 | */ |
||
71 | 123 | public function acceptsLines() |
|
75 | |||
76 | /** |
||
77 | * Whether this is a code block |
||
78 | * |
||
79 | * @return bool |
||
80 | */ |
||
81 | 105 | public function isCode() |
|
85 | |||
86 | 72 | public function matchesNextLine(Cursor $cursor) |
|
90 | |||
91 | /** |
||
92 | * @param ContextInterface $context |
||
93 | * @param Cursor $cursor |
||
94 | */ |
||
95 | 105 | public function handleRemainingContents(ContextInterface $context, Cursor $cursor) |
|
99 | } |
||
100 |