Fix that Registry asArray() can not handle objects recursively

When we call `Registry::toArray()` or `Registry::asArray()`, some objects in this nested array will not be convert to array.

This will make YamlDumper ignore some data in Registry.

I fixed this issue, `asArray()` will return all truly nested array.