PageRenderTime 17ms CodeModel.GetById 12ms app.highlight 2ms RepoModel.GetById 2ms app.codeStats 0ms

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