WP_CLI\Dispatcher

CompositeCommand::__construct()publicWP-CLI 1.0

Instantiate a new CompositeCommand

Method of the class: CompositeCommand{}

No Hooks.

Return

null. Nothing (null).

Usage

$CompositeCommand = new CompositeCommand();
$CompositeCommand->__construct( $parent, $name, $docparser );
$parent(mixed) (required)
Parent command (either Root or Composite)
$name(string) (required)
Represents how command should be invoked
$docparser(DocParser) (required)
-

CompositeCommand::__construct() code WP-CLI 2.8.0-alpha

public function __construct( $parent, $name, $docparser ) {
	$this->parent = $parent;

	$this->name = $name;

	$this->shortdesc = $docparser->get_shortdesc();
	$this->longdesc  = $docparser->get_longdesc();
	$this->docparser = $docparser;

	$when_to_invoke = $docparser->get_tag( 'when' );
	if ( $when_to_invoke ) {
		WP_CLI::get_runner()->register_early_invoke( $when_to_invoke, $this );
	}
}