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 InputArgument

Represents a command line argument.

Namespace: Symfony\Component\Console\Input
Author: Fabien Potencier fabien@symfony.com
Located at Input/InputArgument.php
Methods summary
public
# __construct( string $name, integer $mode = null, string $description = '', mixed $default = null )

Constructor.

Constructor.

Parameters

$name
The argument name
$mode
The argument mode: self::REQUIRED or self::OPTIONAL
$description
A description text
$default
The default value (for self::OPTIONAL mode only)

Throws

Symfony\Component\Console\Exception\InvalidArgumentException
When argument mode is not valid
public string
# getName( )

Returns the argument name.

Returns the argument name.

Returns

string
The argument name
public boolean
# isRequired( )

Returns true if the argument is required.

Returns true if the argument is required.

Returns

boolean
true if parameter mode is self::REQUIRED, false otherwise
public boolean
# isArray( )

Returns true if the argument can take multiple values.

Returns true if the argument can take multiple values.

Returns

boolean
true if mode is self::IS_ARRAY, false otherwise
public
# setDefault( mixed $default = null )

Sets the default value.

Sets the default value.

Parameters

$default
The default value

Throws

Symfony\Component\Console\Exception\LogicException
When incorrect default value is given
public mixed
# getDefault( )

Returns the default value.

Returns the default value.

Returns

mixed
The default value
public string
# getDescription( )

Returns the description text.

Returns the description text.

Returns

string
The description text
Constants summary
integer REQUIRED
# 1
integer OPTIONAL
# 2
integer IS_ARRAY
# 4
Peridot API documentation generated by ApiGen