Overview

Namespaces

  • Contrib
    • Bundle
      • CoverallsBundle
        • Console
        • Entity
      • CoverallsV1Bundle
        • Api
        • Collector
        • Command
        • Config
        • Entity
          • Git
    • Component
      • File
      • Log
      • System
        • Git
  • Guzzle
    • Batch
      • Exception
    • Cache
    • Common
      • Exception
    • Http
      • Curl
      • Exception
      • Message
      • QueryAggregator
    • Inflection
    • Iterator
    • Log
    • Parser
      • Cookie
      • Message
      • UriTemplate
      • Url
    • Plugin
      • Async
      • Backoff
      • Cache
      • Cookie
        • CookieJar
        • Exception
      • CurlAuth
      • ErrorResponse
        • Exception
      • History
      • Log
      • Md5
      • Mock
      • Oauth
    • Service
      • Builder
      • Command
        • Factory
        • LocationVisitor
          • Request
          • Response
      • Description
      • Exception
      • Resource
    • Stream
  • PHP
  • Psr
    • Log
  • Symfony
    • Component
      • Config
        • Definition
          • Builder
          • Exception
        • Exception
        • Loader
        • Resource
        • Util
      • Console
        • Command
        • Formatter
        • Helper
        • Input
        • Output
        • Tester
      • EventDispatcher
        • Debug
      • Finder
        • Adapter
        • Comparator
        • Exception
        • Expression
        • Iterator
        • Shell
      • Stopwatch
      • Yaml
        • Exception

Classes

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

Interfaces

  • InputInterface
  • Overview
  • Namespace
  • Class
  • Tree
  • Todo

Class InputOption

Represents a command line option.

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

Constructor.

Constructor.

Parameters

$name
string
$name The option name
$shortcut
string
$shortcut The shortcut (can be null)
$mode
integer
$mode The option mode: One of the VALUE_* constants
$description
string
$description A description text
$default
mixed
$default The default value (must be null for self::VALUE_REQUIRED or self::VALUE_NONE)

Throws

InvalidArgumentException
If option mode is invalid or incompatible

Api

public string
# getShortcut( )

Returns the option shortcut.

Returns the option shortcut.

Returns

string
The shortcut
public string
# getName( )

Returns the option name.

Returns the option name.

Returns

string
The name
public Boolean
# acceptValue( )

Returns true if the option accepts a value.

Returns true if the option accepts a value.

Returns

Boolean
true if value mode is not self::VALUE_NONE, false otherwise
public Boolean
# isValueRequired( )

Returns true if the option requires a value.

Returns true if the option requires a value.

Returns

Boolean
true if value mode is self::VALUE_REQUIRED, false otherwise
public Boolean
# isValueOptional( )

Returns true if the option takes an optional value.

Returns true if the option takes an optional value.

Returns

Boolean
true if value mode is self::VALUE_OPTIONAL, false otherwise
public Boolean
# isArray( )

Returns true if the option can take multiple values.

Returns true if the option can take multiple values.

Returns

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

Sets the default value.

Sets the default value.

Parameters

$default
mixed
$default The default value

Throws

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
public Boolean
# equals( Symfony\Component\Console\Input\InputOption $option )

Checks whether the given option equals this one

Checks whether the given option equals this one

Parameters

$option
Symfony\Component\Console\Input\InputOption
$option option to compare

Returns

Boolean
Constants summary
integer VALUE_NONE 1
#
integer VALUE_REQUIRED 2
#
integer VALUE_OPTIONAL 4
#
integer VALUE_IS_ARRAY 8
#
php-coveralls API documentation generated by ApiGen 2.8.0