dumpChildren example

use Twig\Profiler\Profile;

/** * @author Fabien Potencier <fabien@symfony.com> */
final class BlackfireDumper
{
    public function dump(Profile $profile): string
    {
        $data = [];
        $this->dumpProfile('main()', $profile$data);
        $this->dumpChildren('main()', $profile$data);

        $start = sprintf('%f', microtime(true));
        $str = <<<EOF file-format: BlackfireProbe cost-dimensions: wt mu pmu request-start: $start EOF;

        foreach ($data as $name => $values) {
            
$item->class = $item->value;
                    // no break                 case Stub::TYPE_OBJECT:
                case Stub::TYPE_RESOURCE:
                    $withChildren = $children && $cursor->depth !== $this->maxDepth && $this->maxItemsPerDepth;
                    $dumper->enterHash($cursor$item->type, $item->class, $withChildren);
                    if ($withChildren) {
                        if ($cursor->skipChildren) {
                            $withChildren = false;
                            $cut = -1;
                        } else {
                            $cut = $this->dumpChildren($dumper$cursor$refs$children$cut$item->type, null !== $item->class);
                        }
                    } elseif ($children && 0 <= $cut) {
                        $cut += \count($children);
                    }
                    $cursor->skipChildren = false;
                    $dumper->leaveHash($cursor$item->type, $item->class, $withChildren$cut);
                    break;

                case Stub::TYPE_SCALAR:
                    $dumper->dumpScalar($cursor, 'default', $item->attr['value']);
                    break;

                
$item->class = $item->value;
                    // no break                 case Stub::TYPE_OBJECT:
                case Stub::TYPE_RESOURCE:
                    $withChildren = $children && $cursor->depth !== $this->maxDepth && $this->maxItemsPerDepth;
                    $dumper->enterHash($cursor$item->type, $item->class, $withChildren);
                    if ($withChildren) {
                        if ($cursor->skipChildren) {
                            $withChildren = false;
                            $cut = -1;
                        } else {
                            $cut = $this->dumpChildren($dumper$cursor$refs$children$cut$item->type, null !== $item->class);
                        }
                    } elseif ($children && 0 <= $cut) {
                        $cut += \count($children);
                    }
                    $cursor->skipChildren = false;
                    $dumper->leaveHash($cursor$item->type, $item->class, $withChildren$cut);
                    break;

                case Stub::TYPE_SCALAR:
                    $dumper->dumpScalar($cursor, 'default', $item->attr['value']);
                    break;

                
Home | Imprint | This part of the site doesn't use cookies.