Completed
Push — master ( ca82a9...888d00 )
by WEBEWEB
01:51
created

HTMLEntityDecodeScrapingCleaner::clean()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
c 0
b 0
f 0
rs 10
cc 3
nc 2
nop 1
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\Scraping\Cleaner;
13
14
use WBW\Library\Core\Scraping\API\ScrapingCleanerInterface;
15
16
/**
17
 * html_entity_decode scraping cleaner.
18
 *
19
 * @author webeweb <https://github.com/webeweb/>
20
 * @package WBW\Library\Core\Scraping\Cleaner
21
 */
22
class HTMLEntityDecodeScrapingCleaner implements ScrapingCleanerInterface {
23
24
    /**
25
     * Constructor.
26
     */
27
    public function __construct() {
28
        // NOTHING TO DO.
29
    }
30
31
    /**
32
     * {@inheritdoc}
33
     */
34
    public function clean($value) {
35
        if (null === $value || false === is_string($value)) {
36
            return null;
37
        }
38
        return html_entity_decode($value);
39
    }
40
41
}
42