You are here

protected function InstallCommand::setMessages in CKEditor Media Embed Plugin 8

Set messages to display to the user at various steps of the installation.

Return value

$this

1 call to InstallCommand::setMessages()
InstallCommand::__construct in src/Command/Drush/InstallCommand.php
Constructs command object.

File

src/Command/Drush/InstallCommand.php, line 69

Class

InstallCommand
Class InstallCommand.

Namespace

Drupal\ckeditor_media_embed\Command\Drush

Code

protected function setMessages() {
  $messages_file = \Drupal::service('module_handler')
    ->getModule('ckeditor_media_embed')
    ->getPath() . '/console/translations/en/ckeditor_media_embed.install.yml';
  $messages = Yaml::decode(file_get_contents($messages_file))['messages'];
  $this->messages = array_map(function ($message) {
    return dt($message);
  }, $messages);
  return $this;
}