Interface that every console dialog validator class must implement.
Source for this file: /ConsoleTools/src/interfaces/dialog_validator.php
Version: | //autogen// |
Child Class | Description |
---|---|
ezcConsoleQuestionDialogValidator | Interface that every console question dialog validator class must implement. |
CONVERT_LOWER
= 1
|
Convert result to lower-case. |
CONVERT_NONE
= 0
|
Perform no conversion on the result. |
CONVERT_UPPER
= 2
|
Convert result to upper-case. |
public mixed |
fixup(
$result
)
Returns a fixed version of the result, if possible. |
public bool |
validate(
$result
)
Returns if the given result is valid. |
Returns a fixed version of the result, if possible.
This method tries to repair the submitted result, if it is not valid, yet. Fixing can be done in different ways, like casting into a certain datatype, string manipulation, creating an object. A result returned by fixup must not necessarily be valid, so a dialog should call validate after trying to fix the result.
Name | Type | Description |
---|---|---|
$result |
mixed | The received result. |
Returns if the given result is valid.
Name | Type | Description |
---|---|---|
$result |
mixed | The received result. |