VarDumperMessage.php in VarDumper 8
File
src/VarDumper/VarDumperMessage.php
View source
<?php
namespace Drupal\vardumper\VarDumper;
use Drupal\Core\Messenger\MessengerInterface;
use Drupal\Core\Render\Markup;
class VarDumperMessage extends VarDumperDebug {
protected $messenger;
public function __construct(MessengerInterface $messenger) {
$this->messenger = $messenger;
}
public function dump($var, $name = '') {
if (!$this
->hasPermission()) {
return;
}
$html = $this
->getHeaders($name, $this
->getDebugInformation()) . $this
->getDebug($var);
$this->messenger
->addStatus(Markup::create($html));
}
}