DefaultsWithDescriptions
class DefaultsWithDescriptions (View source)
An associative array that maps from key to default value; each entry can also have a description and suggested values.
Properties
protected array | $values | ||
protected array | $hasDefault | ||
protected array | $descriptions | ||
protected array | $suggestedValues | ||
protected mixed | $defaultDefault |
Methods
No description
Return just the key : default values mapping
Return true if this set of options is empty
Check to see whether the speicifed key exists in the collection.
Get the value of one entry.
Remove a matching entry, if it exists.
No description
No description
Get the description of one entry.
Get the suggested values for an item.
Add another argument to this command.
Change the default value of an entry.
Check to see if the named argument definitively has a default value.
Remove an entry
Rename an existing option to something else.
Details
__construct($values = [], $defaultDefault = null)
No description
array
getValues()
Return just the key : default values mapping
isEmpty()
Return true if this set of options is empty
bool
exists(string $key)
Check to see whether the speicifed key exists in the collection.
string
get(string $key)
Get the value of one entry.
string
removeMatching(string $key)
Remove a matching entry, if it exists.
approximatelyMatchingKey($key)
No description
protected
simplifyKey($key)
No description
string
getDescription(string $key)
Get the description of one entry.
array|Closure
getSuggestedValues(string $key)
Get the suggested values for an item.
add(string $key, string $description = '', mixed $defaultValue = null, $suggestedValues = [])
Add another argument to this command.
setDefaultValue(string $key, mixed $defaultValue)
Change the default value of an entry.
bool
hasDefault(string $key)
Check to see if the named argument definitively has a default value.
clear(string $key)
Remove an entry
rename($oldName, $newName)
Rename an existing option to something else.