| Conditions | 2 |
| Paths | 2 |
| Total Lines | 18 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 39 | protected function quote( |
||
| 40 | /*# string */ $str, |
||
| 41 | /*# string */ $prefix, |
||
| 42 | /*# string */ $suffix |
||
| 43 | )/*# : string */ { |
||
| 44 | // pattern |
||
| 45 | $pattern = '/^[a-zA-Z\$][0-9a-zA-Z_.\$]*+$/'; |
||
| 46 | if (preg_match($pattern, $str)) { |
||
| 47 | return preg_replace_callback( |
||
| 48 | '/\b([a-zA-Z\$][0-9a-zA-Z_\$]*+)\b/', |
||
| 49 | function($m) use ($prefix, $suffix) { |
||
| 50 | return sprintf('%s%s%s', $prefix, $m[1], $suffix); |
||
| 51 | }, |
||
| 52 | $str |
||
| 53 | ); |
||
| 54 | } |
||
| 55 | return $str; |
||
| 56 | } |
||
| 57 | } |
||
| 58 |