You are here

objectiterateable.php in Devel 8.2

Same filename and directory in other branches
  1. 8 kint/kint/parsers/custom/objectiterateable.php

File

kint/kint/parsers/custom/objectiterateable.php
View source
<?php

class Kint_Parsers_objectIterateable extends kintParser {
  protected function _parse(&$variable) {
    if (!KINT_PHP53 || !is_object($variable) || !$variable instanceof Traversable || stripos(get_class($variable), 'zend') !== false) {
      return false;
    }
    $arrayCopy = iterator_to_array($variable, true);
    if ($arrayCopy === false) {
      return false;
    }
    $this->value = kintParser::factory($arrayCopy)->extendedValue;
    $this->type = 'Iterator contents';
    $this->size = count($arrayCopy);
  }

}

Classes