PHP 클래스 Stecman\Component\Symfony\Console\BashCompletion\CompletionHandler

파일 보기 프로젝트 열기: stecman/symfony-console-completion 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$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[]