MarkdownParser::parse()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 2
eloc 4
c 2
b 0
f 0
nc 2
nop 1
dl 0
loc 6
ccs 4
cts 4
cp 1
crap 2
rs 10
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
?>