Completed
Push — master ( d914a1...8bcbeb )
by Adam
05:43
created

SafeString   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

1 Method

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