WebCommentParser   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 13
c 0
b 0
f 0
wmc 3
lcom 0
cbo 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A shorten() 0 3 1
A parse() 0 6 2
1
<?php
2
namespace rtens\domin\delivery\web;
3
4
use rtens\domin\reflection\CommentParser;
5
6
class WebCommentParser extends CommentParser {
7
8
    public function shorten($description) {
9
        return strip_tags(explode('</p>', parent::shorten($description))[0], '<b><i><s><u><strong><em>');
10
    }
11
12
    public function parse($comment) {
13
        if (class_exists(\Parsedown::class)) {
14
            return (new \Parsedown())->text($comment);
15
        }
16
        return nl2br(parent::parse($comment));
17
    }
18
}