Overview

Namespaces

  • Evenement
  • None
  • Peridot
    • Console
    • Core
    • Reporter
    • Runner
    • Scope
    • Test
  • Symfony
    • Component
      • Console
        • Command
        • Descriptor
        • Event
        • Exception
        • Formatter
        • Helper
        • Input
        • Logger
        • Output
        • Question
        • Style
        • Tester
        • Tests
          • Command
          • Descriptor
          • Fixtures
          • Formatter
          • Helper
          • Input
          • Logger
          • Output
          • Style
          • Tester

Classes

  • ArgvInput
  • ArrayInput
  • Input
  • InputArgument
  • InputDefinition
  • InputOption
  • StringInput

Interfaces

  • InputAwareInterface
  • InputInterface
  • Overview
  • Namespace
  • Class

Class Input

Input is the base class for all concrete Input classes.

Three concrete classes are provided by default: * ArgvInput: The input comes from the CLI arguments (argv) * StringInput: The input is provided as a string * ArrayInput: The input is provided as an array

Symfony\Component\Console\Input\Input implements Symfony\Component\Console\Input\InputInterface

Direct known subclasses

Symfony\Component\Console\Input\ArgvInput, Symfony\Component\Console\Input\ArrayInput

Indirect known subclasses

Symfony\Component\Console\Input\StringInput
Abstract
Namespace: Symfony\Component\Console\Input
Author: Fabien Potencier fabien@symfony.com
Located at Input/Input.php
Methods summary
public
# __construct( Symfony\Component\Console\Input\InputDefinition $definition = null )

Constructor.

Constructor.

Parameters

$definition
A InputDefinition instance
public
# bind( Symfony\Component\Console\Input\InputDefinition $definition )

Binds the current Input instance with the given arguments and options.

Binds the current Input instance with the given arguments and options.

Parameters

$definition
A InputDefinition instance

Implementation of

Symfony\Component\Console\Input\InputInterface::bind()
abstract protected
# parse( )

Processes command line arguments.

Processes command line arguments.

public
# validate( )

Validates the input.

Validates the input.

Throws

Symfony\Component\Console\Exception\RuntimeException
When not enough arguments are given

Implementation of

Symfony\Component\Console\Input\InputInterface::validate()
public boolean
# isInteractive( )

Is this input means interactive?

Is this input means interactive?

Returns

boolean

Implementation of

Symfony\Component\Console\Input\InputInterface::isInteractive()
public
# setInteractive( boolean $interactive )

Sets the input interactivity.

Sets the input interactivity.

Parameters

$interactive
If the input should be interactive

Implementation of

Symfony\Component\Console\Input\InputInterface::setInteractive()
public array
# getArguments( )

Returns all the given arguments merged with the default values.

Returns all the given arguments merged with the default values.

Returns

array

Implementation of

Symfony\Component\Console\Input\InputInterface::getArguments()
public mixed
# getArgument( string $name )

Returns the argument value for a given argument name.

Returns the argument value for a given argument name.

Parameters

$name
The argument name

Returns

mixed
The argument value

Throws

Symfony\Component\Console\Exception\InvalidArgumentException
When argument given doesn't exist

Implementation of

Symfony\Component\Console\Input\InputInterface::getArgument()
public
# setArgument( string $name, string $value )

Sets an argument value by name.

Sets an argument value by name.

Parameters

$name
The argument name
$value
The argument value

Throws

Symfony\Component\Console\Exception\InvalidArgumentException
When argument given doesn't exist

Implementation of

Symfony\Component\Console\Input\InputInterface::setArgument()
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
The InputArgument name or position

Returns

boolean
true if the InputArgument object exists, false otherwise

Implementation of

Symfony\Component\Console\Input\InputInterface::hasArgument()
public array
# getOptions( )

Returns all the given options merged with the default values.

Returns all the given options merged with the default values.

Returns

array

Implementation of

Symfony\Component\Console\Input\InputInterface::getOptions()
public mixed
# getOption( string $name )

Returns the option value for a given option name.

Returns the option value for a given option name.

Parameters

$name
The option name

Returns

mixed
The option value

Throws

Symfony\Component\Console\Exception\InvalidArgumentException
When option given doesn't exist

Implementation of

Symfony\Component\Console\Input\InputInterface::getOption()
public
# setOption( string $name, string|boolean $value )

Sets an option value by name.

Sets an option value by name.

Parameters

$name
The option name
$value
The option value

Throws

Symfony\Component\Console\Exception\InvalidArgumentException
When option given doesn't exist

Implementation of

Symfony\Component\Console\Input\InputInterface::setOption()
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
The InputOption name

Returns

boolean
true if the InputOption object exists, false otherwise

Implementation of

Symfony\Component\Console\Input\InputInterface::hasOption()
public string
# escapeToken( string $token )

Escapes a token through escapeshellarg if it contains unsafe chars.

Escapes a token through escapeshellarg if it contains unsafe chars.

Parameters

$token

Returns

string
Methods inherited from Symfony\Component\Console\Input\InputInterface
getFirstArgument(), getParameterOption(), hasParameterOption()
Properties summary
protected Symfony\Component\Console\Input\InputDefinition $definition
#
protected array $options
# array()
protected array $arguments
# array()
protected boolean $interactive
# true
Peridot API documentation generated by ApiGen