php/WP_CLI/Dispatcher/CommandFactory.php
private static function create_composite_command( $parent, $name, $callable ) {
		$reflection  = new ReflectionClass( $callable );
		$doc_comment = self::get_doc_comment( $reflection );
		if ( ! $doc_comment ) {
			\WP_CLI::debug( null === $doc_comment ? "Failed to get doc comment for {$name}." : "No doc comment for {$name}.", 'commandfactory' );
		}
		$docparser = new \WP_CLI\DocParser( $doc_comment );

		$container = new CompositeCommand( $parent, $name, $docparser );

		foreach ( $reflection->getMethods() as $method ) {
			if ( ! self::is_good_method( $method ) ) {
				continue;
			}

			$class      = is_object( $callable ) ? $callable : $reflection->name;
			$subcommand = self::create_subcommand( $container, false, array( $class, $method->name ), $method );

			$subcommand_name = $subcommand->get_name();

			$container->add_subcommand( $subcommand_name, $subcommand );
		}

		return $container;
	}
private static function create_composite_command( $parent, $name, $callable ) {
		$reflection  = new ReflectionClass( $callable );
		$doc_comment = self::get_doc_comment( $reflection );
		if ( ! $doc_comment ) {
			\WP_CLI::debug( null === $doc_comment ? "Failed to get doc comment for {$name}." : "No doc comment for {$name}.", 'commandfactory' );
		}
		$docparser = new \WP_CLI\DocParser( $doc_comment );

		$container = new CompositeCommand( $parent, $name, $docparser );

		foreach ( $reflection->getMethods() as $method ) {
			if ( ! self::is_good_method( $method ) ) {
				continue;
			}

			$class      = is_object( $callable ) ? $callable : $reflection->name;
			$subcommand = self::create_subcommand( $container, false, array( $class, $method->name ), $method );

			$subcommand_name = $subcommand->get_name();

			$container->add_subcommand( $subcommand_name, $subcommand );
		}

		return $container;
	}
private static function create_composite_command ( $ parent , $ name , $ callable ) { $ reflection = new ReflectionClass ( $ callable ) ; $ doc_comment = self :: get_doc_comment ( $ reflection ) ; if ( ! $ doc_comment ) { \ WP_CLI :: debug ( null === $ doc_comment ? "Failed to get doc comment for {$name}." : "No doc comment for {$name}." , 'commandfactory' ) ; } $ docparser = new \ WP_CLI \ DocParser ( $ doc_comment ) ; $ container = new CompositeCommand ( $ parent , $ name , $ docparser ) ; foreach ( $ reflection -> getMethods ( ) as $ method ) { if ( ! self :: is_good_method ( $ method ) ) { continue ; } $ class = is_object ( $ callable ) ? $ callable : $ reflection -> name ; $ subcommand = self :: create_subcommand ( $ container , false , array ( $ class , $ method -> name ) , $ method ) ; $ subcommand_name = $ subcommand -> get_name ( ) ; $ container -> add_subcommand ( $ subcommand_name , $ subcommand ) ; } return $ container ; }
Create a new Composite command instance.

@param mixed $parent The new command's parent Root or Composite command
@param string $name Represents how the command should be invoked
@param mixed $callable
Create a new Composite command instance .