Overview

Namespaces

  • Webmozart
    • Console
      • Adapter
      • Api
        • Application
        • Args
          • Format
        • Command
        • Config
        • Event
        • Formatter
        • IO
        • Resolver
      • Args
      • Config
      • Formatter
      • Handler
        • Help
      • IO
        • InputStream
        • OutputStream
      • Process
      • Resolver
      • UI
        • Alignment
        • Component
        • Help
        • Layout
        • Style
      • Util

Classes

  • AbstractOption
  • ArgsFormat
  • ArgsFormatBuilder
  • Argument
  • CommandName
  • CommandOption
  • Option

Exceptions

  • InvalidValueException
  • Overview
  • Namespace
  • Class

Class CommandName

A command name in the console arguments.

The command name determines which command should be executed. The console input may contain one or several command names.

In the example below, the console arguments contain the two command names "server" and "add":

$ console server add localhost

The last part "localhost" is the argument to the "server add" command.

Namespace: Webmozart\Console\Api\Args\Format
Author: Bernhard Schussek bschussek@gmail.com
Since: 1.0
See: Webmozart\Console\Api\Args\Format\CommandOption, Webmozart\Console\Api\Args\Format\ArgsFormat
Located at Api/Args/Format/CommandName.php
Methods summary
public
# __construct( string $string, array $aliases = array() )

Creates a new command name.

Creates a new command name.

Parameters

$string
The command name.
$aliases
The alias names.
public string
# toString( )

Returns the command name as string.

Returns the command name as string.

Returns

string
The command name.
public string[]
# getAliases( )

Returns the alias names.

Returns the alias names.

Returns

string[]
The aliases of the command name.
public boolean
# match( string $string )

Returns whether a string matches the command name or one of its aliases.

Returns whether a string matches the command name or one of its aliases.

Parameters

$string
The string to test.

Returns

boolean

Returns true if the given string matches the command name or one of its aliases and false otherwise.

public string
# __toString( )

Casts the command name to a string.

Casts the command name to a string.

Returns

string
The command name.
Webmozart Console API API documentation generated by ApiGen