A InputDefinition represents a set of valid command line arguments and
options.
Usage:
$definition = new InputDefinition(array( new InputArgument('name',
InputArgument::REQUIRED), new InputOption('foo', 'f',
InputOption::VALUE_REQUIRED), ));
Methods summary
public
|
#
__construct( array $definition = array() )
Constructor.
Parameters
- $definition
array $definition An array of InputArgument and InputOption instance
Api
|
public
|
#
setDefinition( array $definition )
Sets the definition of the input.
Sets the definition of the input.
Parameters
- $definition
array $definition The definition array
Api
|
public
|
#
setArguments( array $arguments = array() )
Sets the InputArgument objects.
Sets the InputArgument objects.
Parameters
- $arguments
array $arguments An array of InputArgument objects
Api
|
public
|
|
public
|
|
public
Symfony\Component\Console\Input\InputArgument
|
#
getArgument( string|integer $name )
Returns an InputArgument by name or by position.
Returns an InputArgument by name or by position.
Parameters
- $name
string|integer $name The InputArgument name or position
Returns
Throws
Api
|
public
Boolean
|
#
hasArgument( string|integer $name )
Returns true if an InputArgument object exists by name or position.
Returns true if an InputArgument object exists by name or position.
Parameters
- $name
string|integer $name The InputArgument name or position
Returns
Boolean true if the InputArgument object exists, false otherwise
Api
|
public
array
|
#
getArguments( )
Gets the array of InputArgument objects.
Gets the array of InputArgument objects.
Returns
array An array of InputArgument objects
Api
|
public
integer
|
#
getArgumentCount( )
Returns the number of InputArguments.
Returns the number of InputArguments.
Returns
integer The number of InputArguments
|
public
integer
|
#
getArgumentRequiredCount( )
Returns the number of required InputArguments.
Returns the number of required InputArguments.
Returns
integer The number of required InputArguments
|
public
array
|
|
public
|
#
setOptions( array $options = array() )
Sets the InputOption objects.
Sets the InputOption objects.
Parameters
- $options
array $options An array of InputOption objects
Api
|
public
|
|
public
|
|
public
Symfony\Component\Console\Input\InputOption
|
#
getOption( string $name )
Returns an InputOption by name.
Returns an InputOption by name.
Parameters
- $name
string $name The InputOption name
Returns
Api
|
public
Boolean
|
#
hasOption( string $name )
Returns true if an InputOption object exists by name.
Returns true if an InputOption object exists by name.
Parameters
- $name
string $name The InputOption name
Returns
Boolean true if the InputOption object exists, false otherwise
Api
|
public
array
|
#
getOptions( )
Gets the array of InputOption objects.
Gets the array of InputOption objects.
Returns
array An array of InputOption objects
Api
|
public
Boolean
|
#
hasShortcut( string $name )
Returns true if an InputOption object exists by shortcut.
Returns true if an InputOption object exists by shortcut.
Parameters
- $name
string $name The InputOption shortcut
Returns
Boolean true if the InputOption object exists, false otherwise
|
public
Symfony\Component\Console\Input\InputOption
|
#
getOptionForShortcut( string $shortcut )
Gets an InputOption by shortcut.
Gets an InputOption by shortcut.
Parameters
- $shortcut
string $shortcut the Shortcut name
Returns
|
public
array
|
#
getOptionDefaults( )
Gets an array of default values.
Gets an array of default values.
Returns
array An array of all default values
|
private
string
|
#
shortcutToName( string $shortcut )
Returns the InputOption name given a shortcut.
Returns the InputOption name given a shortcut.
Parameters
- $shortcut
string $shortcut The shortcut
Returns
string The InputOption name
Throws
|
public
string
|
#
getSynopsis( )
Gets the synopsis.
Returns
string The synopsis
|
public
string
|
#
asText( )
Returns a textual representation of the InputDefinition.
Returns a textual representation of the InputDefinition.
Returns
string A string representing the InputDefinition
|
public
string|DOMDocument
|
#
asXml( Boolean $asDom = false )
Returns an XML representation of the InputDefinition.
Returns an XML representation of the InputDefinition.
Parameters
- $asDom
Boolean $asDom Whether to return a DOM or an XML string
Returns
string|DOMDocument An XML string representing the InputDefinition
|
private
|
|