SafeString::makeSafe()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1

Importance

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