VarDumperMessage.php in VarDumper 7
File
src/VarDumper/VarDumperMessage.php
View source
<?php
namespace Drupal\vardumper\VarDumper;
use Drupal\service_container\Legacy\Drupal7;
use Drupal\service_container\Messenger\MessengerInterface;
class VarDumperMessage extends VarDumperDebug {
protected $messenger;
protected $drupal7;
public function __construct(MessengerInterface $messenger, Drupal7 $drupal7) {
$this->messenger = $messenger;
$this->drupal7 = $drupal7;
}
public function dump($var, $name = '') {
if (!$this
->hasPermission()) {
return;
}
$html = $this
->getHeaders($name, $this
->getDebugInformation()) . $this
->getDebug($var);
$this->messenger
->addMessage($html, 'status', FALSE);
}
}