Completed
Pull Request — master (#124)
by
unknown
02:35
created

TMString::trimControls()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 2
1
<?php
2
3
namespace eXpansion\Framework\Core\Helpers;
4
5
class TMString
6
{
7
8
    public static function trimStyles($string)
9
    {
10
        return preg_replace('/(\$[wnoitsgz><]|\$[lh]\[.+\]|\$[lh]|\$[0-9a-f]{3})+/i', '', $string);
11
    }
12
13
    public static function trimControls($string)
14
    {
15
        return preg_replace('/(\$[wnoitsgz><])+/i', '', $string);
16
    }
17
18
    public static function trimColors($string)
19
    {
20
        return preg_replace('/(\$[0-9a-f]{3})+/i', '', $string);
21
    }
22
23
    public static function trimLinks($string)
24
    {
25
        return preg_replace('/(\$[lh]\[.+\]|\$[lh])+/i', '', $string);
26
    }
27
28
}
29