ILIAS
release_6 Revision v6.24-5-g0c8bfefb3b8
|
Public Member Functions | ||||
__construct (callable $is_ok, $error, Data\Factory $data_factory, \ilLanguage $lng) | ||||
If $error is a callable it needs to take two parameters: More... | ||||
check ($value) | ||||
Checks the provided value.Should not throw if accepts($value).
| ||||
accepts ($value) | ||||
Tells if the provided value complies.
| ||||
problemWith ($value) | ||||
Tells what the problem with the provided value is.Should return null if accepts($value).
| ||||
applyTo (Result $result) | ||||
Restricts a Result.Must do nothing with the result if $result->isError(). Must replace the result with an error according to problemWith() if !accepts($result->value()).
| ||||
withProblemBuilder (callable $builder) | ||||
Get a constraint like this one with a builder for a custom error message.problemWith() must return an error message according to the new builder for the new constraint.The builder needs to be callable that takes two parameters:
| ||||
getErrorMessage ($value) | ||||
Get the problem message. More... | ||||
![]() | ||||
transform ($from) | ||||
Perform the transformation. More... | ||||
__invoke ($from) | ||||
Transformations should be callable. More... | ||||
Protected Member Functions | |
getLngClosure () | |
Get the closure to be passed to the error-function that does i18n and sprintf. More... | |
Protected Attributes | |
$data_factory | |
$lng | |
$is_ok | |
$error | |
Definition at line 12 of file Constraint.php.
ILIAS\Refinery\Custom\Constraint::__construct | ( | callable | $is_ok, |
$error, | |||
Data\Factory | $data_factory, | ||
\ilLanguage | $lng | ||
) |
If $error is a callable it needs to take two parameters:
string | callable | $error |
Definition at line 46 of file Constraint.php.
References ILIAS\Refinery\Custom\Constraint\$data_factory, ILIAS\Refinery\Custom\Constraint\$error, ILIAS\Refinery\Custom\Constraint\$is_ok, and ILIAS\Refinery\Custom\Constraint\$lng.
|
final |
Tells if the provided value complies.
mixed | $value |
Implements ILIAS\Refinery\Constraint.
Definition at line 77 of file Constraint.php.
Referenced by ILIAS\Refinery\Custom\Constraint\check(), and ILIAS\Refinery\Custom\Constraint\problemWith().
|
final |
Restricts a Result.Must do nothing with the result if $result->isError(). Must replace the result with an error according to problemWith() if !accepts($result->value()).
Result | $result |
Implements ILIAS\Refinery\Constraint.
Definition at line 97 of file Constraint.php.
References ILIAS\Refinery\Custom\Constraint\$error, $result, ILIAS\Data\Result\isError(), ILIAS\Refinery\Custom\Constraint\problemWith(), and ILIAS\Data\Result\value().
|
final |
Checks the provided value.Should not throw if accepts($value).
Implements ILIAS\Refinery\Constraint.
Definition at line 65 of file Constraint.php.
References ILIAS\Refinery\Custom\Constraint\accepts(), and ILIAS\Refinery\Custom\Constraint\getErrorMessage().
|
final |
Get the problem message.
Definition at line 127 of file Constraint.php.
References ILIAS\Refinery\Custom\Constraint\getLngClosure().
Referenced by ILIAS\Refinery\Custom\Constraint\check(), and ILIAS\Refinery\Custom\Constraint\problemWith().
|
finalprotected |
Get the closure to be passed to the error-function that does i18n and sprintf.
Definition at line 139 of file Constraint.php.
References ILIAS\Refinery\Custom\Constraint\$error, and $i.
Referenced by ILIAS\Refinery\Custom\Constraint\getErrorMessage().
|
final |
Tells what the problem with the provided value is.Should return null if accepts($value).
mixed | $value |
Implements ILIAS\Refinery\Constraint.
Definition at line 85 of file Constraint.php.
References ILIAS\Refinery\Custom\Constraint\accepts(), and ILIAS\Refinery\Custom\Constraint\getErrorMessage().
Referenced by ILIAS\Refinery\Custom\Constraint\applyTo().
|
final |
Get a constraint like this one with a builder for a custom error message.problemWith() must return an error message according to the new builder for the new constraint.The builder needs to be callable that takes two parameters:
callable | $builder |
Implements ILIAS\Refinery\Constraint.
Definition at line 115 of file Constraint.php.
References $builder.
|
protected |
Definition at line 20 of file Constraint.php.
Referenced by ILIAS\Refinery\Password\HasLowerChars\__construct(), ILIAS\Refinery\Password\HasNumbers\__construct(), ILIAS\Refinery\Password\HasUpperChars\__construct(), ILIAS\Refinery\Numeric\IsNumeric\__construct(), ILIAS\Refinery\Password\HasSpecialChars\__construct(), ILIAS\Refinery\String\HasMinLength\__construct(), ILIAS\Refinery\Password\HasMinLength\__construct(), ILIAS\Refinery\Integer\GreaterThan\__construct(), ILIAS\Refinery\String\HasMaxLength\__construct(), ILIAS\Refinery\Integer\LessThan\__construct(), ILIAS\Refinery\IsNull\__construct(), and ILIAS\Refinery\Custom\Constraint\__construct().
|
protected |
Definition at line 35 of file Constraint.php.
Referenced by ILIAS\Refinery\Custom\Constraint\__construct(), ILIAS\Refinery\Custom\Constraint\applyTo(), and ILIAS\Refinery\Custom\Constraint\getLngClosure().
|
protected |
Definition at line 30 of file Constraint.php.
Referenced by ILIAS\Refinery\Custom\Constraint\__construct().
|
protected |
Definition at line 25 of file Constraint.php.
Referenced by ILIAS\Refinery\Password\HasLowerChars\__construct(), ILIAS\Refinery\Password\HasNumbers\__construct(), ILIAS\Refinery\Password\HasUpperChars\__construct(), ILIAS\Refinery\Numeric\IsNumeric\__construct(), ILIAS\Refinery\Password\HasSpecialChars\__construct(), ILIAS\Refinery\Integer\LessThan\__construct(), ILIAS\Refinery\Password\HasMinLength\__construct(), ILIAS\Refinery\String\HasMinLength\__construct(), ILIAS\Refinery\String\HasMaxLength\__construct(), ILIAS\Refinery\Integer\GreaterThan\__construct(), ilAccessibilityDocumentCriterionAssignmentConstraint\__construct(), ILIAS\Refinery\IsNull\__construct(), ilTermsOfServiceDocumentCriterionAssignmentConstraint\__construct(), and ILIAS\Refinery\Custom\Constraint\__construct().