Completed
Pull Request — master (#61)
by Vladimir
09:45
created

RstSyntaxBlock   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 2
dl 0
loc 12
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A process() 0 9 1
1
<?php
2
3
/**
4
 * @copyright 2018 Vladimir Jimenez
5
 * @license   https://github.com/allejo/stakx/blob/master/LICENSE.md MIT
6
 */
7
8
namespace allejo\stakx\Markup;
9
10
use Gregwar\RST\Directives\CodeBlock;
11
use Gregwar\RST\Parser;
12
use Highlight\Highlighter;
13
14
class RstSyntaxBlock extends CodeBlock
15
{
16
    public function process(Parser $parser, $node, $variable, $data, array $options)
17
    {
18
        parent::process($parser, $node, $variable, $data, $options);
19
20
        $highlighter = new Highlighter();
21
        $highlighted = $highlighter->highlight($node->getLanguage(), $node->getValue());
22
23
        $node->setValue($highlighted->value);
24
    }
25
}
26