PHP Класс Webmozart\Console\Api\Args\Format\CommandName

The command name determines which command should be executed. The console input may contain one or several command names. In the example below, the console arguments contain the two command names "server" and "add": $ console server add localhost The last part "localhost" is the argument to the "server add" command.
С версии: 1.0
Автор: Bernhard Schussek ([email protected])
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( string $string, array $aliases = [] ) Creates a new command name.
__toString ( ) : string Casts the command name to a string.
getAliases ( ) : string[] Returns the alias names.
match ( string $string ) : boolean Returns whether a string matches the command name or one of its aliases.
toString ( ) : string Returns the command name as string.

Описание методов

__construct() публичный Метод

Creates a new command name.
public __construct ( string $string, array $aliases = [] )
$string string The command name.
$aliases array The alias names.

__toString() публичный Метод

Casts the command name to a string.
public __toString ( ) : string
Результат string The command name.

getAliases() публичный Метод

Returns the alias names.
public getAliases ( ) : string[]
Результат string[] The aliases of the command name.

match() публичный Метод

Returns whether a string matches the command name or one of its aliases.
public match ( string $string ) : boolean
$string string The string to test.
Результат boolean Returns `true` if the given string matches the command name or one of its aliases and `false` otherwise.

toString() публичный Метод

Returns the command name as string.
public toString ( ) : string
Результат string The command name.