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

TableExtension   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 7

Test Coverage

Coverage 80%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 7
dl 0
loc 25
ccs 8
cts 10
cp 0.8
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
/*
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\Extension\Extension;
16
17
class TableExtension extends Extension
18
{
19 16
    public function getBlockParsers()
20
    {
21
        return [
22 16
            new TableParser(),
23
        ];
24
    }
25
26 16
    public function getBlockRenderers()
27
    {
28
        return [
29 16
            __NAMESPACE__.'\\Table' => new TableRenderer(),
30 16
            __NAMESPACE__.'\\TableCaption' => new TableCaptionRenderer(),
31 16
            __NAMESPACE__.'\\TableRows' => new TableRowsRenderer(),
32 16
            __NAMESPACE__.'\\TableRow' => new TableRowRenderer(),
33 16
            __NAMESPACE__.'\\TableCell' => new TableCellRenderer(),
34
        ];
35
    }
36
37
    public function getName()
38
    {
39
        return 'table';
40
    }
41
}
42