TYPO3  7.6
Public Member Functions | Public Attributes | Private Attributes | List of all members
InputArgument Class Reference

Public Member Functions

 __construct ($name, $mode=null, $description= '', $default=null)
 
 getName ()
 
 isRequired ()
 
 isArray ()
 
 setDefault ($default=null)
 
 getDefault ()
 
 getDescription ()
 

Public Attributes

const REQUIRED = 1
 
const OPTIONAL = 2
 
const IS_ARRAY = 4
 

Private Attributes

 $name
 
 $mode
 
 $default
 
 $description
 

Detailed Description

Represents a command line argument.

Author
Fabien Potencier fabie.nosp@m.n@sy.nosp@m.mfony.nosp@m..com

Definition at line 21 of file InputArgument.php.

Constructor & Destructor Documentation

__construct (   $name,
  $mode = null,
  $description = '',
  $default = null 
)

Constructor.

Parameters
string$nameThe argument name
int$modeThe argument mode: self::REQUIRED or self::OPTIONAL
string$descriptionA description text
mixed$defaultThe default value (for self::OPTIONAL mode only)
Exceptions
\InvalidArgumentExceptionWhen argument mode is not valid

Definition at line 44 of file InputArgument.php.

References InputArgument\$default, InputArgument\$description, InputArgument\$mode, InputArgument\$name, elseif, and InputArgument\setDefault().

Member Function Documentation

getDefault ( )
getDescription ( )
getName ( )
isArray ( )

Returns true if the argument can take multiple values.

Returns
bool true if mode is self::IS_ARRAY, false otherwise

Definition at line 84 of file InputArgument.php.

References InputArgument\$mode.

Referenced by InputDefinition\addArgument(), MarkdownDescriptor\describeInputArgument(), JsonDescriptor\getInputArgumentData(), XmlDescriptor\getInputArgumentDocument(), and InputArgument\setDefault().

isRequired ( )

Returns true if the argument is required.

Returns
bool true if parameter mode is self::REQUIRED, false otherwise

Definition at line 74 of file InputArgument.php.

References InputArgument\$mode.

Referenced by InputDefinition\addArgument(), MarkdownDescriptor\describeInputArgument(), JsonDescriptor\getInputArgumentData(), and XmlDescriptor\getInputArgumentDocument().

setDefault (   $default = null)

Sets the default value.

Parameters
mixed$defaultThe default value
Exceptions
\LogicExceptionWhen incorrect default value is given

Definition at line 96 of file InputArgument.php.

References InputArgument\$default, elseif, and InputArgument\isArray().

Referenced by InputArgument\__construct().

Member Data Documentation

$default
private
$description
private

Definition at line 30 of file InputArgument.php.

Referenced by InputArgument\__construct(), and InputArgument\getDescription().

$mode
private
$name
private

Definition at line 27 of file InputArgument.php.

Referenced by InputArgument\__construct(), and InputArgument\getName().

const IS_ARRAY = 4
const OPTIONAL = 2
const REQUIRED = 1