Passed
Branch master (2e3595)
by Jakub
02:01
created

MarkdownParser   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 13
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A parse() 0 7 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
  public $html5 = true;
14
  public $keepListStartNumber = true;
15
  public $enableNewlines = true;
16
  
17
  public function parse($text): string {
18 1
    $markup = parent::parse($text);
19 1
    if(substr($markup, -1) === PHP_EOL) {
20 1
      $markup = substr($markup, 0, -1);
21
    }
22 1
    return $markup;
23
  }
24
}
25
?>