do_hook() public static method

See WP_CLI::add_hook() for details on WP-CLI's internal hook system. Commands can provide and call their own hooks.
public static do_hook ( string $when ) : null
$when string Identifier for the hook.
return null
 /**
  * Invoke the subcommand with the supplied arguments.
  * Given a --prompt argument, interactively request input
  * from the end user.
  *
  * @param array $args
  * @param array $assoc_args
  */
 public function invoke($args, $assoc_args, $extra_args)
 {
     if (\WP_CLI::get_config('prompt')) {
         list($args, $assoc_args) = $this->prompt_args($args, $assoc_args);
     }
     $to_unset = $this->validate_args($args, $assoc_args, $extra_args);
     foreach ($to_unset as $key) {
         unset($assoc_args[$key]);
     }
     $path = get_path($this->get_parent());
     \WP_CLI::do_hook('before_invoke:' . implode(' ', array_slice($path, 1)));
     call_user_func($this->when_invoked, $args, array_merge($extra_args, $assoc_args));
 }