Completed
Pull Request — master (#309)
by Luc
08:47
created

JsonLdDescriptionToCdbXmlLongDescriptionFilter   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 10 1
1
<?php
2
3
namespace CultuurNet\UDB3\Cdb\Description;
4
5
use CultuurNet\UDB3\StringFilter\CombinedStringFilter;
6
use CultuurNet\UDB3\StringFilter\NewlineToBreakTagStringFilter;
7
8
class JsonLdDescriptionToCdbXmlLongDescriptionFilter extends CombinedStringFilter
9
{
10
    public function __construct()
11
    {
12
        // Convert any \n to a <br> tag.
13
        $nl2brFilter = new NewlineToBreakTagStringFilter();
14
15
        // Make sure \n is replaced with <br> and not <br />.
16
        $nl2brFilter->closeTag(false);
17
18
        $this->addFilter($nl2brFilter);
19
    }
20
}
21