Completed
Push — master ( 83739a...a13ee4 )
by Colin
14s queued 11s
created

TableCell   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 46.67%

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 1
dl 0
loc 40
ccs 7
cts 15
cp 0.4667
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 1
A canContain() 0 4 1
A isCode() 0 4 1
A matchesNextLine() 0 4 1
A handleRemainingContents() 0 3 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\Block\Element\AbstractStringContainerBlock;
20
use League\CommonMark\Block\Element\InlineContainerInterface;
21
use League\CommonMark\ContextInterface;
22
use League\CommonMark\Cursor;
23
24
class TableCell extends AbstractStringContainerBlock implements InlineContainerInterface
25
{
26
    const TYPE_HEAD = 'th';
27
    const TYPE_BODY = 'td';
28
29
    const ALIGN_LEFT = 'left';
30
    const ALIGN_RIGHT = 'right';
31
    const ALIGN_CENTER = 'center';
32
33
    public $type = self::TYPE_BODY;
34
    public $align;
35
36 69
    public function __construct(string $string = '', string $type = self::TYPE_BODY, string $align = null)
37
    {
38 69
        parent::__construct();
39 69
        $this->finalStringContents = $string;
40 69
        $this->addLine($string);
41 69
        $this->type = $type;
42 69
        $this->align = $align;
43 69
    }
44
45
    public function canContain(AbstractBlock $block): bool
46
    {
47
        return false;
48
    }
49
50
    public function isCode(): bool
51
    {
52
        return false;
53
    }
54
55
    public function matchesNextLine(Cursor $cursor): bool
56
    {
57
        return false;
58
    }
59
60
    public function handleRemainingContents(ContextInterface $context, Cursor $cursor): void
61
    {
62
    }
63
}
64