WP_CLI\Dispatcher
CommandFactory::create_namespace
Create a new command namespace instance.
Метод класса: CommandFactory{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$result = CommandFactory::create_namespace( $parent, $name, $callable );
- $parent(разное) (обязательный)
- The new namespace's parent Root or Composite command.
- $name(строка) (обязательный)
- Represents how the command should be invoked.
- $callable(разное) (обязательный)
- .
Код CommandFactory::create_namespace() CommandFactory::create namespace WP-CLI 2.13.0-alpha
private static function create_namespace( $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 DocParser( $doc_comment );
return new CommandNamespace( $parent, $name, $docparser );
}