Conditions | 4 |
Paths | 3 |
Total Lines | 17 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 4.074 |
Changes | 0 |
1 | <?php |
||
59 | 4 | public static function bindParams($command, array $params) |
|
60 | { |
||
61 | 4 | $wrappers = array(); |
|
62 | 4 | $converters = array(); |
|
63 | 4 | foreach ($params as $key => $value) { |
|
64 | |||
65 | // Escaped |
||
66 | 3 | $wrappers[] = '{' . $key . '}'; |
|
67 | 3 | $converters[] = escapeshellarg(is_array($value) ? implode(' ', $value) : $value); |
|
68 | |||
69 | // Unescaped |
||
70 | 3 | $wrappers[] = '{!' . $key . '!}'; |
|
71 | 3 | $converters[] = is_array($value) ? implode(' ', $value) : $value; |
|
72 | 4 | } |
|
73 | |||
74 | 4 | return str_replace($wrappers, $converters, $command); |
|
75 | } |
||
76 | } |
||
77 |