PHP Class MrClay\Cli\Arg
By default, the argument will be assumed to be an optional letter flag with no value following.
If the argument may receive a value, call mayHaveValue(). If there's whitespace after the
flag, the value will be returned as true instead of the string.
If the argument MUST be accompanied by a value, call mustHaveValue(). In this case, whitespace
is permitted between the flag and its value.
Use assertFile() or assertDir() to indicate that the argument must return a string value
specifying a file or directory. During validation, the value will be resolved to a
full file/dir path (not necessarily existing!) and the original value will be accessible
via a "*.raw" key. E.g. $cli->values['f.raw']
Use assertReadable()/assertWritable() to cause the validator to test the file/dir for
read/write permissions respectively.
Datei anzeigen
Open project: mrclay/minify
Protected Properties
Public Methods
Method Details
Note: magic methods declared in class PHPDOC
__construct()
public method
Note: magic properties declared in class PHPDOC
getDefaultSpec()
public method
getDescription()
public method
isRequired()
public method
setDescription()
public method
useAsInfile()
public method
Assert that the argument's value points to a readable file. When
Cli::openInput() is called, a read pointer to this file will
be provided.
useAsOutfile()
public method
Assert that the argument's value points to a writable file. When
Cli::openOutput() is called, a write pointer to this file will
be provided.
Property Details
$description protected_oe property
protected string $description |
return |
string |
|
$required protected_oe property
protected bool $required |
return |
boolean |
|
$spec protected_oe property
protected array $spec |
return |
array |
|