You are here

public function VarDumperConsole::dump in VarDumper 8

Same name and namespace in other branches
  1. 7 modules/vardumper_console/src/VarDumper/VarDumperConsole.php \Drupal\vardumper_console\VarDumper\VarDumperConsole::dump()

.

File

modules/vardumper_console/src/VarDumper/VarDumperConsole.php, line 17

Class

VarDumperConsole
The VarDumperConsole class.

Namespace

Drupal\vardumper_console\VarDumper

Code

public function dump($var, $name = '') {
  $cloner = new VarCloner();
  $dumper = new CliDumper('php://stdout');
  $html = $this
    ->border(strip_tags($this
    ->getHeaders($name, $this
    ->getDebugInformation()))) . "\n";
  file_put_contents('php://stdout', $html);
  $dumper
    ->dump($cloner
    ->cloneVar($var));
}