CleanHelper::clean()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 2
Bugs 1 Features 0
Metric Value
c 2
b 1
f 0
dl 0
loc 5
ccs 0
cts 5
cp 0
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
crap 2
1
<?php
2
3
namespace Padosoft\TesseraSanitaria;
4
5
/**
6
 * Class CleanHelper
7
 * @package Padosoft\TesseraSanitaria
8
 */
9
class CleanHelper
10
{
11
    /**
12
     * CleanHelper constructor.
13
     */
14
    public function __construct()
15
    {
16
    }
17
18
    /**
19
     * @param $value
20
     *
21
     * @return mixed
22
     */
23
    public function clean($value)
24
    {
25
        $value = preg_replace('/[\x00-\x1F\x80-\xFF]/', '', trim(html_entity_decode($value)));
26
        return $value;
27
    }
28
}
29
30