class VarDumperConsole in VarDumper 8
Same name and namespace in other branches
- 7 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 12
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, mb_strlen($string));
return implode("\n", [
$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 |