Completed
Push — master ( dc2700...65f918 )
by Martin
22:42 queued 16:21
created

TableRows::handleRemainingContents()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

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