objectiterateable.php 561 B

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