Collection class for ezcConsoleArgument objects. Used in ezcConsoleInput.
Source for this file: /ConsoleTools/src/input/arguments.php
Version: | //autogen// |
protected array(string=>ezcConsoleArgument) |
$named
= array()
Named list of arguments. |
protected array(ezcConsoleArgument) |
$ordered
= array()
Ordered list of arguments. |
public int |
count(
)
Returns the number of registered arguments. |
public ezcConsoleArgument |
current(
)
Returns the currently selected argument from the list. |
public string |
key(
)
Returns the key of the currently selected argument from the list. |
public ezcConsoleArgument |
next(
)
Advances the internal pointer to the next argument and returns it. |
public bool |
offsetExists(
$offset
)
Returns if the given offset exists. |
public ezcConsoleArgument |
offsetGet(
$offset
)
Returns the element with the given offset. |
public void |
offsetSet(
$offset
, $value
)
Set the element with the given offset. |
public void |
offsetUnset(
$offset
)
Unset the element with the given offset. |
public ezcConsoleArgument |
rewind(
)
Rewinds the internal pointer to the first argument and returns it. |
public bool |
valid(
)
Checks if the current position is valid. |
Returns the number of registered arguments.
Method | Description |
---|---|
Countable::count |
Returns the currently selected argument from the list.
Used by foreach-Loops.
Method | Description |
---|---|
Iterator::current |
Returns the key of the currently selected argument from the list.
Used by foreach-Loops. In contrast to the iteration direction, which is defined by the ordered list of arguments, this is the name of the argument.
Method | Description |
---|---|
Iterator::key |
Advances the internal pointer to the next argument and returns it.
Used by foreach-Loops.
Method | Description |
---|---|
Iterator::next |
Returns if the given offset exists.
This method is part of the ArrayAccess interface to allow access to the data of this object as if it was an array. Valid offsets are integers or strings. If an integer is used, it refers to the position in the command line. A string refers to the arguments name property.
Name | Type | Description |
---|---|---|
$offset |
mixed | The offset to check. |
Type | Description |
---|---|
ezcBaseValueException |
If the provided offset is neither an integer, nor a string. |
Method | Description |
---|---|
ArrayAccess::offsetExists |
Returns the element with the given offset.
This method is part of the ArrayAccess interface to allow access to the data of this object as if it was an array. Valid offsets are integers or strings. If an integer is used, it refers to the position in the command line. A string refers to the arguments name property.
Name | Type | Description |
---|---|---|
$offset |
string|integer | The offset to check. |
Type | Description |
---|---|
ezcBaseValueException |
If the provided offset is neither an integer, nor a string. |
Method | Description |
---|---|
ArrayAccess::offsetGet |
Set the element with the given offset.
This method is part of the ArrayAccess interface to allow access to the data of this object as if it was an array. In contrast to the other ArrayAccess implementations of this class, this method allows only integer keys.
Name | Type | Description |
---|---|---|
$offset |
int | The offset to assign an item to. |
$value |
ezcConsoleArgument | The argument object to register. |
Type | Description |
---|---|
ezcBaseValueException |
If a non integer offset is provided. |
ezcBaseValueException |
If the provided value is not of type {@ling ezcConsoleTableRow}. |
ezcConsoleArgumentAlreadyRegisteredException |
If an argument with the given offset or name is already registered. |
Method | Description |
---|---|
ArrayAccess::offsetSet |
Unset the element with the given offset.
This method is part of the ArrayAccess interface to allow access to the data of this object as if it was an array. In contrast to the other ArrayAccess implementations of this class, this method allows only integer keys.
Name | Type | Description |
---|---|---|
$offset |
int | The offset to unset the value for. |
Type | Description |
---|---|
ezcBaseValueException |
If a non numeric row offset is used. |
Method | Description |
---|---|
ArrayAccess::offsetUnset |
Rewinds the internal pointer to the first argument and returns it.
Used by foreach-Loops.
Method | Description |
---|---|
Iterator::rewind |
Checks if the current position is valid.
Used by foreach-Loops.
Method | Description |
---|---|
Iterator::valid |