TYPO3  7.6
Public Member Functions | Public Attributes | Private Member Functions | List of all members
StringInput Class Reference
Inheritance diagram for StringInput:
ArgvInput Input InputInterface

Public Member Functions

 __construct ($input, InputDefinition $definition=null)
 
- Public Member Functions inherited from ArgvInput
 __construct (array $argv=null, InputDefinition $definition=null)
 
 getFirstArgument ()
 
 hasParameterOption ($values)
 
 getParameterOption ($values, $default=false)
 
 __toString ()
 
- Public Member Functions inherited from Input
 __construct (InputDefinition $definition=null)
 
 bind (InputDefinition $definition)
 
 validate ()
 
 isInteractive ()
 
 setInteractive ($interactive)
 
 getArguments ()
 
 getArgument ($name)
 
 setArgument ($name, $value)
 
 hasArgument ($name)
 
 getOptions ()
 
 getOption ($name)
 
 setOption ($name, $value)
 
 hasOption ($name)
 
 escapeToken ($token)
 

Public Attributes

const REGEX_STRING = '([^\s]+?)(?:\s|(?<!\\\\)"|(?<!\\\\)\'|$)'
 
const REGEX_QUOTED_STRING = '(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"|\'([^\'\\\\]*(?:\\\\.[^\'\\\\]*)*)\')'
 

Private Member Functions

 tokenize ($input)
 

Additional Inherited Members

- Protected Member Functions inherited from ArgvInput
 setTokens (array $tokens)
 
 parse ()
 
- Protected Attributes inherited from Input
 $definition
 
 $options = array()
 
 $arguments = array()
 
 $interactive = true
 

Detailed Description

StringInput represents an input provided as a string.

Usage:

$input = new StringInput('foo --bar="foobar"');
Author
Fabien Potencier fabie.nosp@m.n@sy.nosp@m.mfony.nosp@m..com

Definition at line 25 of file StringInput.php.

Constructor & Destructor Documentation

__construct (   $input,
InputDefinition  $definition = null 
)

Constructor.

Parameters
string$inputAn array of parameters from the CLI (in the argv format)
InputDefinition$definitionA InputDefinition instance
Deprecated:
The second argument is deprecated as it does not work (will be removed in 3.0), use 'bind' method instead

Definition at line 40 of file StringInput.php.

References Input\$definition, Input\bind(), ArgvInput\setTokens(), and StringInput\tokenize().

Member Function Documentation

tokenize (   $input)
private

Tokenizes a string.

Parameters
string$inputThe input to tokenize
Returns
array An array of tokens
Exceptions
\InvalidArgumentExceptionWhen unable to parse input (should never happen)

Definition at line 64 of file StringInput.php.

References ArgvInput\$tokens, and elseif.

Referenced by StringInput\__construct().

Member Data Documentation

const REGEX_QUOTED_STRING = '(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"|\'([^\'\\\\]*(?:\\\\.[^\'\\\\]*)*)\')'

Definition at line 28 of file StringInput.php.

const REGEX_STRING = '([^\s]+?)(?:\s|(?<!\\\\)"|(?<!\\\\)\'|$)'

Definition at line 27 of file StringInput.php.