You are here

protected function Kint_Parsers_objectIterateable::_parse in Devel 8.2

Same name and namespace in other branches
  1. 8 kint/kint/parsers/custom/objectiterateable.php \Kint_Parsers_objectIterateable::_parse()

* main and usually single method a custom parser must implement * *

Parameters

mixed $variable: * * @return mixed [!!!] false is returned if the variable is not of current type

Overrides kintParser::_parse

File

kint/kint/parsers/custom/objectiterateable.php, line 5

Class

Kint_Parsers_objectIterateable

Code

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);
}