TableRow   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 0
dl 0
loc 29
ccs 0
cts 19
cp 0
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A canContain() 0 4 1
A isCode() 0 4 1
A matchesNextLine() 0 4 1
A handleRemainingContents() 0 3 1
A children() 0 4 1
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 isCode(): bool
30
    {
31
        return false;
32
    }
33
34
    public function matchesNextLine(Cursor $cursor): bool
35
    {
36
        return false;
37
    }
38
39
    public function handleRemainingContents(ContextInterface $context, Cursor $cursor): void
40
    {
41
    }
42
43
    /**
44
     * @return AbstractBlock[]
45
     */
46
    public function children(): iterable
47
    {
48
        return array_filter((array) parent::children(), static function (Node $child): bool { return $child instanceof AbstractBlock; });
0 ignored issues
show
Bug introduced by
The class League\CommonMark\Block\Element\AbstractBlock does not exist. Did you forget a USE statement, or did you not list all dependencies?

This error could be the result of:

1. Missing dependencies

PHP Analyzer uses your composer.json file (if available) to determine the dependencies of your project and to determine all the available classes and functions. It expects the composer.json to be in the root folder of your repository.

Are you sure this class is defined by one of your dependencies, or did you maybe not list a dependency in either the require or require-dev section?

2. Missing use statement

PHP does not complain about undefined classes in ìnstanceof checks. For example, the following PHP code will work perfectly fine:

if ($x instanceof DoesNotExist) {
    // Do something.
}

If you have not tested against this specific condition, such errors might go unnoticed.

Loading history...
49
    }
50
}
51