Completed
Push — master ( 94bc98...2d9023 )
by Martin
09:18
created

TableRow::children()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 3
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This is part of the webuni/commonmark-table-extension package.
7
 *
8
 * (c) Martin Hasoň <[email protected]>
9
 * (c) Webuni s.r.o. <[email protected]>
10
 *
11
 * For the full copyright and license information, please view the LICENSE
12
 * file that was distributed with this source code.
13
 */
14
15
namespace Webuni\CommonMark\TableExtension;
16
17
use League\CommonMark\Block\Element\AbstractBlock;
18
use League\CommonMark\ContextInterface;
19
use League\CommonMark\Cursor;
20
use League\CommonMark\Node\Node;
21
22
class TableRow extends AbstractBlock
23
{
24
    public function canContain(AbstractBlock $block): bool
25
    {
26
        return $block instanceof TableCell;
27
    }
28
29
    public function acceptsLines(): bool
30
    {
31
        return false;
32
    }
33
34
    public function isCode(): bool
35
    {
36
        return false;
37
    }
38
39
    public function matchesNextLine(Cursor $cursor): bool
40
    {
41
        return false;
42
    }
43
44
    public function handleRemainingContents(ContextInterface $context, Cursor $cursor): void
45
    {
46
    }
47
48
    /**
49
     * @return AbstractBlock[]
50
     */
51
    public function children(): array
52
    {
53
        return array_filter(parent::children(), function (Node $child): bool { return $child instanceof AbstractBlock; });
54
    }
55
}
56