PHP Класс Stecman\Component\Symfony\Console\BashCompletion\CompletionHandler

Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$application Symfony\Component\Console\Application Application to complete for
$command Symfony\Component\Console\Command\Command
$context CompletionContext
$helpers Stecman\Component\Symfony\Console\BashCompletion\Completion\CompletionInterface[] Array of completion helpers.

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

Метод Описание
__construct ( Application $application, CompletionContext $context = null )
addHandler ( Stecman\Component\Symfony\Console\BashCompletion\Completion\CompletionInterface $helper )
addHandlers ( array $array )
getContext ( ) : CompletionContext
getInput ( ) : Symfony\Component\Console\Input\ArrayInput Get an InputInterface representation of the completion context
runCompletion ( ) : string[] Do the actual completion, returning an array of strings to provide to the parent shell's completion system
setContext ( CompletionContext $context )

Защищенные методы

Метод Описание
completeForCommandArguments ( ) : array | false Attempt to complete the current word as a command argument value
completeForCommandName ( ) : array | false Attempt to complete the current word as a command name
completeForOptionShortcutValues ( ) : array | false Attempt to complete the current word as the value of an option shortcut
completeForOptionShortcuts ( ) : array | false Attempt to complete the current word as an option shortcut.
completeForOptionValues ( ) : array | false Attemp to complete the current word as the value of a long-form option
completeForOptions ( ) : array | false Attempt to complete the current word as a long-form option (--my-option)
completeOption ( Symfony\Component\Console\Input\InputOption $option ) : array | false Complete the value for the given option if a value completion is availble
filterResults ( array $array ) : string[] Filter out results that don't match the current word on the command line
getAllOptions ( ) : Symfony\Component\Console\Input\InputOption[] Get the combined options of the application and entered command
getCompletionHelper ( string $name, string $type ) : Stecman\Component\Symfony\Console\BashCompletion\Completion\CompletionInterface | null Find a CompletionInterface that matches the current command, target name, and target type
getOptionWordsWithValues ( ) : string[] Build a list of option words/flags that will have a value after them Options are returned in the format they appear as on the command line.
mapArgumentsToWords ( Symfony\Component\Console\Input\InputArgument[] $argumentDefinitions ) : array Step through the command line to determine which word positions represent which argument values

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

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

public __construct ( Application $application, CompletionContext $context = null )
$application Symfony\Component\Console\Application
$context CompletionContext

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

public addHandler ( Stecman\Component\Symfony\Console\BashCompletion\Completion\CompletionInterface $helper )
$helper Stecman\Component\Symfony\Console\BashCompletion\Completion\CompletionInterface

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

public addHandlers ( array $array )
$array array

completeForCommandArguments() защищенный Метод

Attempt to complete the current word as a command argument value
См. также: Symfony\Component\Console\Input\InputArgument
protected completeForCommandArguments ( ) : array | false
Результат array | false

completeForCommandName() защищенный Метод

Attempt to complete the current word as a command name
protected completeForCommandName ( ) : array | false
Результат array | false

completeForOptionShortcutValues() защищенный Метод

Attempt to complete the current word as the value of an option shortcut
protected completeForOptionShortcutValues ( ) : array | false
Результат array | false

completeForOptionShortcuts() защищенный Метод

If the shortcut exists it will be completed, but a list of possible shortcuts is never returned for completion.
protected completeForOptionShortcuts ( ) : array | false
Результат array | false

completeForOptionValues() защищенный Метод

Attemp to complete the current word as the value of a long-form option
protected completeForOptionValues ( ) : array | false
Результат array | false

completeForOptions() защищенный Метод

Attempt to complete the current word as a long-form option (--my-option)
protected completeForOptions ( ) : array | false
Результат array | false

completeOption() защищенный Метод

Complete the value for the given option if a value completion is availble
protected completeOption ( Symfony\Component\Console\Input\InputOption $option ) : array | false
$option Symfony\Component\Console\Input\InputOption
Результат array | false

filterResults() защищенный Метод

Filter out results that don't match the current word on the command line
protected filterResults ( array $array ) : string[]
$array array
Результат string[]

getAllOptions() защищенный Метод

Get the combined options of the application and entered command
protected getAllOptions ( ) : Symfony\Component\Console\Input\InputOption[]
Результат Symfony\Component\Console\Input\InputOption[]

getCompletionHelper() защищенный Метод

Find a CompletionInterface that matches the current command, target name, and target type
protected getCompletionHelper ( string $name, string $type ) : Stecman\Component\Symfony\Console\BashCompletion\Completion\CompletionInterface | null
$name string
$type string
Результат Stecman\Component\Symfony\Console\BashCompletion\Completion\CompletionInterface | null

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

public getContext ( ) : CompletionContext
Результат CompletionContext

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

Get an InputInterface representation of the completion context
public getInput ( ) : Symfony\Component\Console\Input\ArrayInput
Результат Symfony\Component\Console\Input\ArrayInput

getOptionWordsWithValues() защищенный Метод

Build a list of option words/flags that will have a value after them Options are returned in the format they appear as on the command line.
protected getOptionWordsWithValues ( ) : string[]
Результат string[] - eg. ['--myoption', '-m', ... ]

mapArgumentsToWords() защищенный Метод

The word indexes of argument values are found by eliminating words that are known to not be arguments (options, option values, and command names). Any word that doesn't match for elimination is assumed to be an argument value,
protected mapArgumentsToWords ( Symfony\Component\Console\Input\InputArgument[] $argumentDefinitions ) : array
$argumentDefinitions Symfony\Component\Console\Input\InputArgument[]
Результат array as [argument name => word index on command line]

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

Do the actual completion, returning an array of strings to provide to the parent shell's completion system
public runCompletion ( ) : string[]
Результат string[]

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

public setContext ( CompletionContext $context )
$context CompletionContext

Описание свойств

$application защищенное свойство

Application to complete for
protected Application,Symfony\Component\Console $application
Результат Symfony\Component\Console\Application

$command защищенное свойство

protected Command,Symfony\Component\Console\Command $command
Результат Symfony\Component\Console\Command\Command

$context защищенное свойство

protected CompletionContext,Stecman\Component\Symfony\Console\BashCompletion $context
Результат CompletionContext

$helpers защищенное свойство

Array of completion helpers.
protected CompletionInterface[],Stecman\Component\Symfony\Console\BashCompletion\Completion $helpers
Результат Stecman\Component\Symfony\Console\BashCompletion\Completion\CompletionInterface[]