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

SafeString::makeSafe()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 1
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 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