Method | Description | |
---|---|---|
__construct ( $name = 'UNKNOWN', $version = 'UNKNOWN' ) | ||
command ( string $expression, callable | string | array $callable, array $aliases = [] ) : |
Define a CLI command using a string expression and a callable. | |
getContainer ( ) : Interop\Container\ContainerInterface | null | Returns the container that has been configured, or null. | |
getInvoker ( ) : Invoker\InvokerInterface | ||
runCommand ( string $command, Symfony\Component\Console\Output\OutputInterface $output = null ) : integer | Helper to run a sub-command from a command. | |
setInvoker ( Invoker\InvokerInterface $invoker ) | ||
useContainer ( Interop\Container\ContainerInterface $container, boolean $injectByTypeHint = false, boolean $injectByParameterName = false ) | Set up the application to use a container to resolve callables. |
Method | Description | |
---|---|---|
assertCallableIsValid ( $callable ) | ||
createCommand ( $expression, callable $callable ) | ||
createParameterResolver ( ) : ParameterResolver | Create the default parameter resolver. | |
defaultsViaReflection ( $command, $callable ) | ||
isStaticCallToNonStaticMethod ( mixed $callable ) : boolean | Check if the callable represents a static call to a non-static method. |
public command ( string $expression, callable | string | array $callable, array $aliases = [] ) : |
||
$expression | string | Defines the arguments and options of the command. |
$callable | callable | string | array | Called when the command is called. When using a container, this can be a "pseudo-callable" i.e. the name of the container entry to invoke. |
$aliases | array | An array of aliases for the command. |
return |
public getContainer ( ) : Interop\Container\ContainerInterface | null | ||
return | Interop\Container\ContainerInterface | null |
public getInvoker ( ) : Invoker\InvokerInterface | ||
return | Invoker\InvokerInterface |
public runCommand ( string $command, Symfony\Component\Console\Output\OutputInterface $output = null ) : integer | ||
$command | string | Command that should be run. |
$output | Symfony\Component\Console\Output\OutputInterface | The output to use. If not provided, the output will be silenced. |
return | integer | 0 if everything went fine, or an error code |
public setInvoker ( Invoker\InvokerInterface $invoker ) | ||
$invoker | Invoker\InvokerInterface |
public useContainer ( Interop\Container\ContainerInterface $container, boolean $injectByTypeHint = false, boolean $injectByParameterName = false ) | ||
$container | Interop\Container\ContainerInterface | Container implementing container-interop |
$injectByTypeHint | boolean | |
$injectByParameterName | boolean |