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

  • ArgvArgs
  • DefaultArgsParser
  • StringArgs
  • TokenParser
  • Overview
  • Namespace
  • Class

Class StringArgs

Console arguments passed as a string.

Webmozart\Console\Args\StringArgs implements Webmozart\Console\Api\Args\RawArgs
Namespace: Webmozart\Console\Args
Author: Bernhard Schussek bschussek@gmail.com
Since: 1.0
Located at Args/StringArgs.php
Methods summary
public
# __construct( string $string )

Creates the console arguments.

Creates the console arguments.

Parameters

$string
The console arguments string.
public string|null
# getScriptName( )

Returns the PHP script as it was called on the console.

Returns the PHP script as it was called on the console.

Returns

string|null

The script name or null if no script name is available.

Implementation of

Webmozart\Console\Api\Args\RawArgs::getScriptName()
public boolean
# hasToken( string $token )

Returns whether the console arguments contain a given token.

Returns whether the console arguments contain a given token.

Parameters

$token
The token to look for.

Returns

boolean

Returns true if the arguments contain the token and false otherwise.

Implementation of

Webmozart\Console\Api\Args\RawArgs::hasToken()
public string[]
# getTokens( )

Returns the tokens of the console arguments.

Returns the tokens of the console arguments.

Returns

string[]
The argument tokens.

Implementation of

Webmozart\Console\Api\Args\RawArgs::getTokens()
public string
# toString( boolean $scriptName = true )

Returns the console arguments as string.

Returns the console arguments as string.

Parameters

$scriptName
Whether to include the script name in the output.

Returns

string
The arguments as string.

Implementation of

Webmozart\Console\Api\Args\RawArgs::toString()
Webmozart Console API API documentation generated by ApiGen