name = $class.' Iterator Contents'; $b->access_path = 'iterator_to_array('.$o->access_path.', true)'; $b->depth = $o->depth + 1; $b->hints[] = 'blacklist'; $r = new Representation('Iterator'); $r->contents = array($b); $o->addRepresentation($r); return; } } /** @var array|false */ $data = \iterator_to_array($var); if (false === $data) { return; } $base_obj = new BasicObject(); $base_obj->depth = $o->depth; if ($o->access_path) { $base_obj->access_path = 'iterator_to_array('.$o->access_path.')'; } $r = new Representation('Iterator'); $r->contents = $this->parser->parse($data, $base_obj); $r->contents = $r->contents->value->contents; $primary = $o->getRepresentations(); $primary = \reset($primary); if ($primary && $primary === $o->value && $primary->contents === array()) { $o->addRepresentation($r, 0); } else { $o->addRepresentation($r); } } }