| Conditions | 2 |
| Paths | 2 |
| Total Lines | 12 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 2.0116 |
| Changes | 0 | ||
| 1 | <?php |
||
| 24 | 3 | public static function execute($object) |
|
| 25 | { |
||
| 26 | 3 | if (!is_object($object)) { |
|
| 27 | throw new \InvalidArgumentException('To extract variables from an object, you must supply an object.'); |
||
| 28 | } |
||
| 29 | |||
| 30 | 3 | $objectArray = (array) $object; |
|
| 31 | 3 | $out = json_encode($objectArray); |
|
| 32 | 3 | $out = preg_replace('/\\\u0000[*a-zA-Z_\x7f-\xff\\\][a-zA-Z0-9_\x7f-\xff\\\]*\\\u0000/', '', $out); |
|
| 33 | |||
| 34 | 3 | return json_decode($out, true); |
|
| 35 | } |
||
| 36 | } |