MarkdownParser   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 8
c 2
b 0
f 0
dl 0
loc 14
ccs 5
cts 5
cp 1
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A parse() 0 6 2
1
<?php
2
declare(strict_types=1);
3
4
namespace Nexendrie\SiteGenerator;
5
6
/**
7
 * MarkdownParser
8
 *
9
 * @author Jakub Konečný
10
 * @internal
11
 */
12 1
final class MarkdownParser extends \cebe\markdown\GithubMarkdown {
13
  /** @var bool */
14
  public $html5 = true;
15
  /** @var bool */
16
  public $keepListStartNumber = true;
17
  /** @var bool */
18
  public $enableNewlines = true;
19
20
  public function parse($text): string {
21 1
    $markup = parent::parse($text);
22 1
    if(substr($markup, -1) === PHP_EOL) {
23 1
      $markup = substr($markup, 0, -1);
24
    }
25 1
    return $markup;
26
  }
27
}
28
?>