[ Index ]

PHP Cross Reference of phpBB-3.1.12-deutsch

title

Body

[close]

/vendor/symfony/console/Symfony/Component/Console/Input/ -> ArgvInput.php (summary)

(no description)

File Size: 349 lines (11 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

ArgvInput:: (13 methods):
  __construct()
  setTokens()
  parse()
  parseShortOption()
  parseShortOptionSet()
  parseLongOption()
  parseArgument()
  addShortOption()
  addLongOption()
  getFirstArgument()
  hasParameterOption()
  getParameterOption()
  __toString()


Class: ArgvInput  - X-Ref

ArgvInput represents an input coming from the CLI arguments.

Usage:

$input = new ArgvInput();

By default, the `$_SERVER['argv']` array is used for the input values.

This can be overridden by explicitly passing the input values in the constructor:

$input = new ArgvInput($_SERVER['argv']);

If you pass it yourself, don't forget that the first element of the array
is the name of the running application.

When passing an argument to the constructor, be sure that it respects
the same rules as the argv one. It's almost always better to use the
`StringInput` when you want to provide your own input.

__construct(array $argv = null, InputDefinition $definition = null)   X-Ref
Constructor.

param: array           $argv       An array of parameters from the CLI (in the argv format)
param: InputDefinition $definition A InputDefinition instance

setTokens(array $tokens)   X-Ref
No description

parse()   X-Ref
Processes command line arguments.


parseShortOption($token)   X-Ref
Parses a short option.

param: string $token The current token.

parseShortOptionSet($name)   X-Ref
Parses a short option set.

param: string $name The current token

parseLongOption($token)   X-Ref
Parses a long option.

param: string $token The current token

parseArgument($token)   X-Ref
Parses an argument.

param: string $token The current token

addShortOption($shortcut, $value)   X-Ref
Adds a short option value.

param: string $shortcut The short option key
param: mixed  $value    The value for the option

addLongOption($name, $value)   X-Ref
Adds a long option value.

param: string $name  The long option key
param: mixed  $value The value for the option

getFirstArgument()   X-Ref
Returns the first argument from the raw parameters (not parsed).

return: string The value of the first argument or null otherwise

hasParameterOption($values)   X-Ref
Returns true if the raw parameters (not parsed) contain a value.

This method is to be used to introspect the input parameters
before they have been validated. It must be used carefully.

param: string|array $values The value(s) to look for in the raw parameters (can be an array)
return: bool true if the value is contained in the raw parameters

getParameterOption($values, $default = false)   X-Ref
Returns the value of a raw option (not parsed).

This method is to be used to introspect the input parameters
before they have been validated. It must be used carefully.

param: string|array $values  The value(s) to look for in the raw parameters (can be an array)
param: mixed        $default The default value to return if no result is found
return: mixed The option value

__toString()   X-Ref
Returns a stringified representation of the args passed to the command.

return: string



Generated: Thu Jan 11 00:25:41 2018 Cross-referenced by PHPXref 0.7.1