Completed
Push — master ( d214bd...7d804e )
by Colin
50:05 queued 48:49
created

TableRow   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 1
dl 0
loc 27
ccs 9
cts 9
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A children() 0 6 1
A canContain() 0 4 1
A isCode() 0 4 1
A matchesNextLine() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This is part of the league/commonmark 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\Extension\Table;
17
18
use League\CommonMark\Block\Element\AbstractBlock;
19
use League\CommonMark\Cursor;
20
use League\CommonMark\Node\Node;
21
22
final class TableRow extends AbstractBlock
23
{
24 3
    public function canContain(AbstractBlock $block): bool
25
    {
26 3
        return $block instanceof TableCell;
27
    }
28
29 3
    public function isCode(): bool
30
    {
31 3
        return false;
32
    }
33
34 3
    public function matchesNextLine(Cursor $cursor): bool
35
    {
36 3
        return false;
37
    }
38
39
    /**
40
     * @return AbstractBlock[]
41
     */
42 72
    public function children(): iterable
43
    {
44
        return array_filter((array) parent::children(), static function (Node $child): bool {
45 69
            return $child instanceof AbstractBlock;
46 72
        });
47
    }
48
}
49