splobjectstorage.php 551 B

123456789101112131415161718192021222324
  1. <?php
  2. class Kint_Parsers_SplObjectStorage extends kintParser
  3. {
  4. protected function _parse( & $variable )
  5. {
  6. if ( !is_object( $variable ) || !$variable instanceof SplObjectStorage ) return false;
  7. /** @var $variable SplObjectStorage */
  8. $count = $variable->count();
  9. if ( $count === 0 ) return false;
  10. $variable->rewind();
  11. while ( $variable->valid() ) {
  12. $current = $variable->current();
  13. $this->value[] = kintParser::factory( $current );
  14. $variable->next();
  15. }
  16. $this->type = 'Storage contents';
  17. $this->size = $count;
  18. }
  19. }