Completed
Push — master ( 94bc98...2d9023 )
by Martin
09:18
created

TableExtension   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 7

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 7
dl 0
loc 25
ccs 0
cts 20
cp 0
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getBlockParsers() 0 6 1
A getBlockRenderers() 0 10 1
A getName() 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\Extension\Extension;
18
19
class TableExtension extends Extension
20
{
21
    public function getBlockParsers(): array
22
    {
23
        return [
24
            new TableParser(),
25
        ];
26
    }
27
28
    public function getBlockRenderers(): array
29
    {
30
        return [
31
            __NAMESPACE__.'\\Table' => new TableRenderer(),
32
            __NAMESPACE__.'\\TableCaption' => new TableCaptionRenderer(),
33
            __NAMESPACE__.'\\TableRows' => new TableRowsRenderer(),
34
            __NAMESPACE__.'\\TableRow' => new TableRowRenderer(),
35
            __NAMESPACE__.'\\TableCell' => new TableCellRenderer(),
36
        ];
37
    }
38
39
    public function getName(): string
40
    {
41
        return 'table';
42
    }
43
}
44