CleanUpPre   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 20
ccs 6
cts 6
cp 1
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A rule() 0 3 1
A render() 0 3 1
1
<?php # -*- coding: utf-8 -*-
2
declare(strict_types=1);
3
4
namespace Bueltge\Marksimple\Rule;
5
6
class CleanUpPre extends AbstractRegexRule
7
{
8
9
    /**
10
     * Get the regex rule to identify the content for the callback.
11
     * Clean up pre code blocks to get for a block only one pre code block, not each line.
12
     *
13
     * @return string
14
     */
15 4
    public function rule(): string
16 4
    {
17 4
        return '#<\/code><\/pre>\n<pre><code(>| .*?>)#';
18
    }
19
20
    /**
21
     * {@inheritdoc}
22
     */
23 1
    public function render(array $content): string
24 1
    {
25 1
        return '<br>';
26
    }
27
}
28