Completed
Push — master ( 586b8e...cb0e4b )
by De Cramer
04:39 queued 53s
created

TMString   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 25%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 4
lcom 0
cbo 0
dl 0
loc 24
ccs 2
cts 8
cp 0.25
rs 10
c 1
b 0
f 1

4 Methods

Rating   Name   Duplication   Size   Complexity  
A trimControls() 0 4 1
A trimColors() 0 4 1
A trimLinks() 0 4 1
A trimStyles() 0 4 1
1
<?php
2
3
namespace eXpansion\Framework\Core\Helpers;
4
5
class TMString
6
{
7
8 3
    public static function trimStyles($string)
9
    {
10 3
        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