Class ArgvArgs
Console arguments passed via PHP's "argv" variable.
-
Webmozart\Console\Args\ArgvArgs
implements
Webmozart\Console\Api\Args\RawArgs
Methods summary
public
|
#
__construct( array $argv = null )
Creates the console arguments.
Creates the console arguments.
Parameters
- $argv
The contents of the "argv" variable or null to read
the global "argv" variable.
|
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
|
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
|
public
string[]
|
#
getTokens( )
Returns the tokens of the console arguments.
Returns the tokens of the console arguments.
Returns
string[] The argument tokens.
Implementation of
|
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
|