Completed
Push — master ( 984d76...8152ca )
by WEBEWEB
04:38
created

HTMLEntityDecodeTransformer   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 0
dl 0
loc 19
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A transform() 0 6 3
1
<?php
2
3
/*
4
 * This file is part of the core-library package.
5
 *
6
 * (c) 2018 WEBEWEB
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace WBW\Library\Core\Transformer;
13
14
use WBW\Library\Core\Transformer\API\TransformerInterface;
15
16
/**
17
 * html_entity_decode transformer.
18
 *
19
 * @author webeweb <https://github.com/webeweb/>
20
 * @package WBW\Library\Core\Transformer
21
 */
22
class HTMLEntityDecodeTransformer implements TransformerInterface {
23
24
    /**
25
     * Constructor.
26
     */
27
    public function __construct() {
28
        // NOTHING TO DO.
29
    }
30
31
    /**
32
     * {@inheritdoc}
33
     */
34
    public function transform($value) {
35
        if (null === $value || false === is_string($value)) {
36
            return null;
37
        }
38
        return html_entity_decode($value);
39
    }
40
}
41