class VarDumperConsole in VarDumper 7
Same name and namespace in other branches
- 8 modules/vardumper_console/src/VarDumper/VarDumperConsole.php \Drupal\vardumper_console\VarDumper\VarDumperConsole
The VarDumperConsole class.
Hierarchy
- class \Drupal\vardumper\VarDumper\VarDumperDebug
- class \Drupal\vardumper_console\VarDumper\VarDumperConsole
Expanded class hierarchy of VarDumperConsole
1 string reference to 'VarDumperConsole'
- vardumper_console.services.yml in modules/
vardumper_console/ vardumper_console.services.yml - modules/vardumper_console/vardumper_console.services.yml
1 service uses VarDumperConsole
- vardumper_console in modules/
vardumper_console/ vardumper_console.services.yml - \Drupal\vardumper_console\VarDumper\VarDumperConsole
File
- modules/
vardumper_console/ src/ VarDumper/ VarDumperConsole.php, line 16 - Contains Drupal\vardumper_console\VarDumper\VarDumperConsole.
Namespace
Drupal\vardumper_console\VarDumperView source
class VarDumperConsole extends VarDumperDebug {
/**
* {@inheritdoc}
*/
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));
}
/**
* Helper method to add a border around the header in console.
*/
private function border($string, $character = '*') {
$string = $character . " " . $string . " " . $character;
$line = str_repeat($character, strlen($string));
return implode("\n", array(
$line,
$string,
$line,
));
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
VarDumperConsole:: |
private | function | Helper method to add a border around the header in console. | |
VarDumperConsole:: |
public | function | ||
VarDumperDebug:: |
protected | property | ||
VarDumperDebug:: |
protected | property | ||
VarDumperDebug:: |
public | function | ||
VarDumperDebug:: |
public | function | ||
VarDumperDebug:: |
public | function | ||
VarDumperDebug:: |
public | function |