function DevelCommands::event

Same name in other branches
  1. 5.x src/Commands/DevelCommands.php \Drupal\devel\Commands\DevelCommands::event()
  2. 5.x src/Drush/Commands/DevelCommands.php \Drupal\devel\Drush\Commands\DevelCommands::event()

List implementations of a given event and optionally edit one.

@command devel:event

@usage devel-event Pick a Kernel event, then pick an implementation, and then view its source code. @usage devel-event kernel.terminate Pick a terminate subscribers implementation and view its source code. @aliases fne,fn-event,event

Parameters

string $event: The name of the event to explore. If omitted, a list of events is shown.

string $implementation: The name of the implementation to show. Usually omitted.

File

src/Commands/DevelCommands.php, line 164

Class

DevelCommands
Class DevelCommands.

Namespace

Drupal\devel\Commands

Code

public function event($event, $implementation) {
    $info = $this->codeLocate($implementation);
    $exec = self::getEditor();
    $cmd = sprintf($exec, Escape::shellArg($info['file']));
    $process = $this->processManager()
        ->shell($cmd);
    $process->setTty(TRUE);
    $process->mustRun();
}