TableRow::canContain()   A
last analyzed

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