Object to recipe isn`t really converting to array
19th opened this issue · comments
Ilya commented
Is it worth to have such kind of method if it's just type casting?
If Object will be recursive, it won`t really convert it to array.
public static function objectToArray($object)
{
if (is_object($object)) {
return (array) $object;
} else {
throw new \Exception("Not an object");
}
}
Maybe better to replace it with known "hack" with json encode and decode or remove it at all?
Nick Gejadze commented
You are absolutely right!
Nick Gejadze commented
Thank you!