PHP 클래스 Webmozart\Console\Api\Config\Config

부터: 1.0
저자: Bernhard Schussek ([email protected])
파일 보기 프로젝트 열기: webmozart/console 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( ) Creates a new configuration.
addArgument ( string $name, integer $flags, string $description = null, mixed $default = null ) : ApplicationConfig | CommandConfig | SubCommandConfig | OptionCommandConfig Adds an argument.
addOption ( string $longName, string $shortName = null, integer $flags, string $description = null, mixed $default = null, string $valueName = '...' ) : ApplicationConfig | CommandConfig | SubCommandConfig | OptionCommandConfig Adds an option.
disableLenientArgsParsing ( ) : ApplicationConfig | CommandConfig | SubCommandConfig | OptionCommandConfig Disables lenient argument parsing.
enableLenientArgsParsing ( ) : ApplicationConfig | CommandConfig | SubCommandConfig | OptionCommandConfig Enables lenient argument parsing.
getArgsParser ( ) : Webmozart\Console\Api\Args\ArgsParser Returns the configured argument parser.
getArguments ( ) : Argument[] Returns the configured arguments.
getHandler ( ) : object Returns the command handler to execute when a command is run.
getHandlerMethod ( ) : string Returns the method of the command handler that should be executed when the configured command is run.
getHelperSet ( ) : Symfony\Component\Console\Helper\HelperSet Returns the configured helper set.
getOptions ( ) : Option[] Returns the configured options.
isLenientArgsParsingEnabled ( ) : boolean Returns whether lenient argument parsing is enabled.
setArgsParser ( Webmozart\Console\Api\Args\ArgsParser $argsParser ) : ApplicationConfig | CommandConfig | SubCommandConfig | OptionCommandConfig Sets the used argument parser.
setHandler ( object | callback $handler ) : ApplicationConfig | CommandConfig | SubCommandConfig | OptionCommandConfig Sets the command handler to execute when a command is run.
setHandlerMethod ( string $handlerMethod ) : ApplicationConfig | CommandConfig | SubCommandConfig | OptionCommandConfig Sets the method of the command handler that should be executed when the configured command is run.
setHelperSet ( Symfony\Component\Console\Helper\HelperSet $helperSet ) : ApplicationConfig | CommandConfig | SubCommandConfig | OptionCommandConfig Sets the used helper set.

보호된 메소드들

메소드 설명
configure ( ) Adds the default configuration.
getDefaultArgsParser ( ) : Webmozart\Console\Api\Args\ArgsParser Returns the arguments parser to use if none is set.
getDefaultHandler ( ) : object Returns the command handler to use if none is set.
getDefaultHandlerMethod ( ) : string Returns the handler method to use if none is set.
getDefaultHelperSet ( ) : Symfony\Component\Console\Helper\HelperSet Returns the helper set to use if none is set.
getDefaultLenientArgsParsing ( ) : boolean Returns whether the arguments parsing handles errors gracefully.

메소드 상세

__construct() 공개 메소드

Creates a new configuration.
public __construct ( )

addArgument() 공개 메소드

Read {@link Argument} for a more detailed description of console arguments.
또한 보기: getArguments()
public addArgument ( string $name, integer $flags, string $description = null, mixed $default = null ) : ApplicationConfig | CommandConfig | SubCommandConfig | OptionCommandConfig
$name string The argument name.
$flags integer A bitwise combination of the flag constants in the {@link Argument} class.
$description string A one-line description of the argument.
$default mixed The default value. Must be `null` if the flags contain {@link Argument::REQUIRED}.
리턴 ApplicationConfig | CommandConfig | SubCommandConfig | OptionCommandConfig The current instance.

addOption() 공개 메소드

Read {@link Option} for a more detailed description of console options.
또한 보기: getOptions()
public addOption ( string $longName, string $shortName = null, integer $flags, string $description = null, mixed $default = null, string $valueName = '...' ) : ApplicationConfig | CommandConfig | SubCommandConfig | OptionCommandConfig
$longName string The long option name.
$shortName string The short option name. Can be `null`.
$flags integer A bitwise combination of the flag constants in the {@link Option} class.
$description string A one-line description of the option.
$default mixed The default value. Must be `null` if the flags contain {@link Option::REQUIRED_VALUE}.
$valueName string The name of the value to be used in usage examples of the option.
리턴 ApplicationConfig | CommandConfig | SubCommandConfig | OptionCommandConfig The current instance.

configure() 보호된 메소드

Override this method in your own subclasses.
protected configure ( )

disableLenientArgsParsing() 공개 메소드

When lenient argument parsing is enabled, the argument parser will not fail if the console arguments contain invalid or missing arguments. Lenient argument parsing is disabled by default.
또한 보기: enableLenientArgsParsing()
public disableLenientArgsParsing ( ) : ApplicationConfig | CommandConfig | SubCommandConfig | OptionCommandConfig
리턴 ApplicationConfig | CommandConfig | SubCommandConfig | OptionCommandConfig The current instance.

enableLenientArgsParsing() 공개 메소드

When lenient argument parsing is enabled, the argument parser will not fail if the console arguments contain invalid or missing arguments. Lenient argument parsing is disabled by default.
또한 보기: disableLenientArgsParsing()
public enableLenientArgsParsing ( ) : ApplicationConfig | CommandConfig | SubCommandConfig | OptionCommandConfig
리턴 ApplicationConfig | CommandConfig | SubCommandConfig | OptionCommandConfig The current instance.

getArgsParser() 공개 메소드

Returns the configured argument parser.
또한 보기: setArgsParser()
public getArgsParser ( ) : Webmozart\Console\Api\Args\ArgsParser
리턴 Webmozart\Console\Api\Args\ArgsParser The argument parser.

getArguments() 공개 메소드

Read {@link Argument} for a more detailed description of arguments.
또한 보기: addArgument()
public getArguments ( ) : Argument[]
리턴 Webmozart\Console\Api\Args\Format\Argument[] The configured arguments.

getDefaultArgsParser() 보호된 메소드

Returns the arguments parser to use if none is set.
protected getDefaultArgsParser ( ) : Webmozart\Console\Api\Args\ArgsParser
리턴 Webmozart\Console\Api\Args\ArgsParser The default args parser.

getDefaultHandler() 보호된 메소드

Returns the command handler to use if none is set.
protected getDefaultHandler ( ) : object
리턴 object The default command handler.

getDefaultHandlerMethod() 보호된 메소드

Returns the handler method to use if none is set.
protected getDefaultHandlerMethod ( ) : string
리턴 string The default handler method.

getDefaultHelperSet() 보호된 메소드

Returns the helper set to use if none is set.
protected getDefaultHelperSet ( ) : Symfony\Component\Console\Helper\HelperSet
리턴 Symfony\Component\Console\Helper\HelperSet The default helper set.

getDefaultLenientArgsParsing() 보호된 메소드

Returns whether the arguments parsing handles errors gracefully.
protected getDefaultLenientArgsParsing ( ) : boolean
리턴 boolean The default value for lenient args parsing.

getHandler() 공개 메소드

Returns the command handler to execute when a command is run.
또한 보기: setHandler()
public getHandler ( ) : object
리턴 object The command handler.

getHandlerMethod() 공개 메소드

Returns the method of the command handler that should be executed when the configured command is run.
또한 보기: setHandlerMethod()
public getHandlerMethod ( ) : string
리턴 string The method name.

getHelperSet() 공개 메소드

Returns the configured helper set.
또한 보기: setHelperSet()
public getHelperSet ( ) : Symfony\Component\Console\Helper\HelperSet
리턴 Symfony\Component\Console\Helper\HelperSet The helper set.

getOptions() 공개 메소드

Read {@link Option} for a more detailed description of console options.
또한 보기: addOption()
public getOptions ( ) : Option[]
리턴 Webmozart\Console\Api\Args\Format\Option[] The configured options.

isLenientArgsParsingEnabled() 공개 메소드

When lenient argument parsing is enabled, the argument parser will not fail if the console arguments contain invalid or missing arguments.
public isLenientArgsParsingEnabled ( ) : boolean
리턴 boolean Returns `true` if lenient parsing is enabled and `false` otherwise.

setArgsParser() 공개 메소드

Sets the used argument parser.
또한 보기: getArgsParser()
public setArgsParser ( Webmozart\Console\Api\Args\ArgsParser $argsParser ) : ApplicationConfig | CommandConfig | SubCommandConfig | OptionCommandConfig
$argsParser Webmozart\Console\Api\Args\ArgsParser The argument parser.
리턴 ApplicationConfig | CommandConfig | SubCommandConfig | OptionCommandConfig The current instance.

setHandler() 공개 메소드

You can pass: * An object with handler methods. * A callable that receives a {@link Command} and returns an object with handler methods. The name of the executed handler method can be configured with {@link setHandlerMethod()}. By default, the method handle() is executed.
또한 보기: getHandler()
public setHandler ( object | callback $handler ) : ApplicationConfig | CommandConfig | SubCommandConfig | OptionCommandConfig
$handler object | callback The command handler or the callable creating a new command handler on demand.
리턴 ApplicationConfig | CommandConfig | SubCommandConfig | OptionCommandConfig The current instance.

setHandlerMethod() 공개 메소드

The method receives three arguments: * {@link Args} $args: The console arguments. * {@link IO} $io: The I/O. * {@link Command} $command: The executed command.
또한 보기: getHandlerMethod()
public setHandlerMethod ( string $handlerMethod ) : ApplicationConfig | CommandConfig | SubCommandConfig | OptionCommandConfig
$handlerMethod string The method name.
리턴 ApplicationConfig | CommandConfig | SubCommandConfig | OptionCommandConfig The current instance.

setHelperSet() 공개 메소드

Sets the used helper set.
또한 보기: getHelperSet()
public setHelperSet ( Symfony\Component\Console\Helper\HelperSet $helperSet ) : ApplicationConfig | CommandConfig | SubCommandConfig | OptionCommandConfig
$helperSet Symfony\Component\Console\Helper\HelperSet The helper set.
리턴 ApplicationConfig | CommandConfig | SubCommandConfig | OptionCommandConfig The current instance.