You are here

class VarDumperMessage in VarDumper 7

Same name and namespace in other branches
  1. 8 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 14
Contains Drupal\vardumper\VarDumper\VarDumperMessage.

Namespace

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

  /**
   * The Messenger service.
   *
   * @var \Drupal\service_container\Messenger\LegacyMessenger
   */
  protected $messenger;

  /**
   * The Drupal7 legacy service.
   *
   * @var \Drupal\service_container\Legacy\Drupal7
   */
  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);
  }

}

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::$drupal7 protected property The Drupal7 legacy service.
VarDumperMessage::$messenger protected property The Messenger service.
VarDumperMessage::dump public function
VarDumperMessage::__construct public function