php/WP_CLI/Runner.php
private function do_early_invoke( $when ) {
		if ( ! isset( $this->early_invoke[ $when ] ) ) {
			return;
		}

		// Search the value of @when from the command method.
		$real_when = '';
		$r         = $this->find_command_to_run( $this->arguments );
		if ( is_array( $r ) ) {
			list( $command, $final_args, $cmd_path ) = $r;

			foreach ( $this->early_invoke as $_when => $_path ) {
				foreach ( $_path as $cmd ) {
					if ( $cmd === $cmd_path ) {
						$real_when = $_when;
					}
				}
			}
		}

		foreach ( $this->early_invoke[ $when ] as $path ) {
			if ( $this->cmd_starts_with( $path ) ) {
				if ( empty( $real_when ) || ( $real_when && $real_when === $when ) ) {
					$this->run_command_and_exit();
				}
			}
		}
	}
private function do_early_invoke( $when ) {
		if ( ! isset( $this->early_invoke[ $when ] ) ) {
			return;
		}

		// Search the value of @when from the command method.
		$real_when = '';
		$r         = $this->find_command_to_run( $this->arguments );
		if ( is_array( $r ) ) {
			list( $command, $final_args, $cmd_path ) = $r;

			foreach ( $this->early_invoke as $_when => $_path ) {
				foreach ( $_path as $cmd ) {
					if ( $cmd === $cmd_path ) {
						$real_when = $_when;
					}
				}
			}
		}

		foreach ( $this->early_invoke[ $when ] as $path ) {
			if ( $this->cmd_starts_with( $path ) ) {
				if ( empty( $real_when ) || ( $real_when && $real_when === $when ) ) {
					$this->run_command_and_exit();
				}
			}
		}
	}
private function do_early_invoke ( $ when ) { if ( ! isset ( $ this -> early_invoke [ $ when ] ) ) { return ; } // Search the value of @when from the command method. $ real_when = '' ; $ r = $ this -> find_command_to_run ( $ this -> arguments ) ; if ( is_array ( $ r ) ) { list ( $ command , $ final_args , $ cmd_path ) = $ r ; foreach ( $ this -> early_invoke as $ _when => $ _path ) { foreach ( $ _path as $ cmd ) { if ( $ cmd === $ cmd_path ) { $ real_when = $ _when ; } } } } foreach ( $ this -> early_invoke [ $ when ] as $ path ) { if ( $ this -> cmd_starts_with ( $ path ) ) { if ( empty ( $ real_when ) || ( $ real_when && $ real_when === $ when ) ) { $ this -> run_command_and_exit ( ) ; } } } }
Perform the early invocation of a command.

@param string $when Named execution hook
Perform the early invocation of a command .