1 <?php
2
3 class Kint_Parsers_objectIterateable extends kintParser
4 {
5 protected function _parse( & $variable )
6 {
7 if ( !KINT_PHP53
8 || !is_object( $variable )
9 || !$variable instanceof Traversable
10 || stripos( get_class( $variable ), 'zend' ) !== false
11 ) return false;
12
13
14 $arrayCopy = iterator_to_array( $variable, true );
15
16 if ( $arrayCopy === false ) return false;
17
18 $this->value = kintParser::factory( $arrayCopy )->extendedValue;
19 $this->type = 'Iterator contents';
20 $this->size = count( $arrayCopy );
21 }
22 }