You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
761 B
PHP
34 lines
761 B
PHP
<?php
|
|
|
|
/**
|
|
* @internal
|
|
*/
|
|
class SageParsersSplObjectStorage implements SageParserInterface
|
|
{
|
|
public function replacesAllOtherParsers()
|
|
{
|
|
return false;
|
|
}
|
|
|
|
public function parse(&$variable, $varData)
|
|
{
|
|
if (! SageHelper::isRichMode() || ! is_object($variable) || ! $variable instanceof SplObjectStorage) {
|
|
return false;
|
|
}
|
|
|
|
$count = $variable->count();
|
|
if ($count === 0) {
|
|
return false;
|
|
}
|
|
|
|
$variable->rewind();
|
|
$arrayCopy = array();
|
|
while ($variable->valid()) {
|
|
$arrayCopy[] = $variable->current();
|
|
$variable->next();
|
|
}
|
|
|
|
$varData->addTabToView($variable, "Storage contents ({$count})", $arrayCopy);
|
|
}
|
|
}
|