src/Schema.php
private function toObjectArray(\Traversable $value) {
        $class = get_class($value);
        if ($value instanceof \ArrayObject) {
            return new $class($value->getArrayCopy(), $value->getFlags(), $value->getIteratorClass());
        } elseif ($value instanceof \ArrayAccess) {
            $r = new $class;
            foreach ($value as $k => $v) {
                $r[$k] = $v;
            }
            return $r;
        }
        return iterator_to_array($value);
    }
private function toObjectArray(\Traversable $value) {
        $class = get_class($value);
        if ($value instanceof \ArrayObject) {
            return new $class($value->getArrayCopy(), $value->getFlags(), $value->getIteratorClass());
        } elseif ($value instanceof \ArrayAccess) {
            $r = new $class;
            foreach ($value as $k => $v) {
                $r[$k] = $v;
            }
            return $r;
        }
        return iterator_to_array($value);
    }
private function toObjectArray ( \ Traversable $ value ) { $ class = get_class ( $ value ) ; if ( $ value instanceof \ ArrayObject ) { return new $ class ( $ value -> getArrayCopy ( ) , $ value -> getFlags ( ) , $ value -> getIteratorClass ( ) ) ; } elseif ( $ value instanceof \ ArrayAccess ) { $ r = new $ class ; foreach ( $ value as $ k => $ v ) { $ r [ $ k ] = $ v ; } return $ r ; } return iterator_to_array ( $ value ) ; }
Cast a value to an array.

@param \Traversable $value The value to convert.
@return array Returns an array.
Cast a value to an array .