expression; return $token; } elseif ($data instanceof \JsonSerializable) { $data = $data->jsonSerialize(); } elseif ($data instanceof Arrayable) { $data = $data->toArray(); } else { $result = []; foreach ($data as $name => $value) { $result[$name] = $value; } $data = $result; } if ($data === []) { return new \stdClass(); } } if (is_array($data)) { foreach ($data as $key => $value) { if (is_array($value) || is_object($value)) { $data[$key] = static::processData($value, $expressions, $expPrefix); } } } return $data; } }