| Conditions | 5 |
| Paths | 2 |
| Total Lines | 19 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| 1 | <?php |
||
| 20 | public static function humanToPlain($value) |
||
| 21 | { |
||
| 22 | if (is_array($value)) { |
||
| 23 | return $value; |
||
| 24 | } |
||
| 25 | $value = preg_replace_callback('~(".*?")|(\'.*?\')|(\s*,\s*)~s', function ($m) { |
||
| 26 | if (!empty($m[3])) { |
||
| 27 | return "\x00"; |
||
| 28 | } |
||
| 29 | if (!empty($m[2])) { |
||
| 30 | return substr($m[2], 1, -1); |
||
| 31 | } |
||
| 32 | if (!empty($m[1])) { |
||
| 33 | return substr($m[1], 1, -1); |
||
| 34 | } |
||
| 35 | return null; |
||
| 36 | }, $value); |
||
| 37 | return explode("\x00", $value); |
||
| 38 | } |
||
| 39 | } |
||
| 40 |