You are here

class VarDumperMessage in VarDumper 8

Same name and namespace in other branches
  1. 7 src/VarDumper/VarDumperMessage.php \Drupal\vardumper\VarDumper\VarDumperMessage

Hierarchy

Expanded class hierarchy of VarDumperMessage

1 string reference to 'VarDumperMessage'
vardumper.services.yml in ./vardumper.services.yml
vardumper.services.yml
1 service uses VarDumperMessage
vardumper_message in ./vardumper.services.yml
\Drupal\vardumper\VarDumper\VarDumperMessage

File

src/VarDumper/VarDumperMessage.php, line 8

Namespace

Drupal\vardumper\VarDumper
View source
class VarDumperMessage extends VarDumperDebug {

  /**
   * The messenger.
   *
   * @var \Drupal\Core\Messenger\MessengerInterface
   */
  protected $messenger;

  /**
   * {@inheritdoc}.
   */
  public function __construct(MessengerInterface $messenger) {
    $this->messenger = $messenger;
  }

  /**
   * {@inheritdoc}.
   */
  public function dump($var, $name = '') {
    if (!$this
      ->hasPermission()) {
      return;
    }
    $html = $this
      ->getHeaders($name, $this
      ->getDebugInformation()) . $this
      ->getDebug($var);
    $this->messenger
      ->addStatus(Markup::create($html));
  }

}

Members

Namesort descending Modifiers Type Description Overrides
VarDumperDebug::$header1 protected property
VarDumperDebug::$header2 protected property
VarDumperDebug::getDebug public function
VarDumperDebug::getDebugInformation public function
VarDumperDebug::getHeaders public function
VarDumperDebug::hasPermission public function
VarDumperMessage::$messenger protected property The messenger.
VarDumperMessage::dump public function .
VarDumperMessage::__construct public function .