Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. HtmlDumper.php

function HtmlDumper::enterHash

Overrides CliDumper::enterHash

File

vendor/symfony/var-dumper/Dumper/HtmlDumper.php, line 789

Class

HtmlDumper
HtmlDumper dumps variables as HTML.

Namespace

Symfony\Component\VarDumper\Dumper

Code

public function enterHash(Cursor $cursor, int $type, string|int|null $class, bool $hasChild) : void {
    if (Cursor::HASH_OBJECT === $type) {
        $cursor->attr['depth'] = $cursor->depth;
    }
    parent::enterHash($cursor, $type, $class, false);
    if ($cursor->skipChildren || $cursor->depth >= $this->displayOptions['maxDepth']) {
        $cursor->skipChildren = false;
        $eol = ' class=sf-dump-compact>';
    }
    else {
        $this->expandNextHash = false;
        $eol = ' class=sf-dump-expanded>';
    }
    if ($hasChild) {
        $this->line .= '<samp data-depth=' . ($cursor->depth + 1);
        if ($cursor->refIndex) {
            $r = Cursor::HASH_OBJECT !== $type ? 1 - (Cursor::HASH_RESOURCE !== $type) : 2;
            $r .= $r && 0 < $cursor->softRefHandle ? $cursor->softRefHandle : $cursor->refIndex;
            $this->line .= \sprintf(' id=%s-ref%s', $this->dumpId, $r);
        }
        $this->line .= $eol;
        $this->dumpLine($cursor->depth);
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal