Version 1
[yaffs-website] / web / modules / contrib / devel / kint / kint / parsers / custom / splobjectstorage.php
diff --git a/web/modules/contrib/devel/kint/kint/parsers/custom/splobjectstorage.php b/web/modules/contrib/devel/kint/kint/parsers/custom/splobjectstorage.php
new file mode 100644 (file)
index 0000000..69da91f
--- /dev/null
@@ -0,0 +1,24 @@
+<?php
+
+class Kint_Parsers_SplObjectStorage extends kintParser
+{
+       protected function _parse( & $variable )
+       {
+               if ( !is_object( $variable ) || !$variable instanceof SplObjectStorage ) return false;
+
+               /** @var $variable SplObjectStorage */
+
+               $count = $variable->count();
+               if ( $count === 0 ) return false;
+
+               $variable->rewind();
+               while ( $variable->valid() ) {
+                       $current       = $variable->current();
+                       $this->value[] = kintParser::factory( $current );
+                       $variable->next();
+               }
+
+               $this->type = 'Storage contents';
+               $this->size = $count;
+       }
+}
\ No newline at end of file