SafeString   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 13
c 0
b 0
f 0
wmc 1
lcom 0
cbo 0
rs 10
ccs 2
cts 2
cp 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A makeSafe() 0 4 1
1
<?php
2
3
namespace DBAL\Modifiers;
4
5
class SafeString
6
{
7
    
8
    /**
9
     * Make any SQL field names safe
10
     * @param string $string The string that you wish to make safe
11
     * @return string Will return the safe value
12 9
     */
13 9
    public static function makeSafe($string)
14
    {
15
        return (string)preg_replace("/[^A-Za-z0-9_]/", "", $string);
16
    }
17
}
18