/class/libraries/vendor/raveren/kint/parsers/custom/splobjectstorage.php

https://gitlab.com/VoyaTrax/vtCMS2 · PHP · 24 lines · 18 code · 5 blank · 1 comment · 4 complexity · 5ffe5f2b51469f89957ea9ce33f4c21d MD5 · raw file

  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. }