ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
ILIAS\Refinery\Numeric\IsNumeric Class Reference
+ Inheritance diagram for ILIAS\Refinery\Numeric\IsNumeric:
+ Collaboration diagram for ILIAS\Refinery\Numeric\IsNumeric:

Public Member Functions

 __construct (Data\Factory $data_factory, \ilLanguage $lng)
 
- Public Member Functions inherited from 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: More...
 
 check ($value)
 Checks the provided value.Should not throw if accepts($value).
Exceptions
More...
 
 accepts ($value)
 Tells if the provided value complies.
Parameters
mixed$value
Returns
bool
More...
 
 problemWith ($value)
 Tells what the problem with the provided value is.Should return null if accepts($value).
Parameters
mixed$value
Returns
string|null
More...
 
 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()).
Parameters
Result$result
Returns
Result
More...
 
 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:
Parameters
callable$builder
Returns
Constraint
More...
 
 getErrorMessage ($value)
 Get the problem message. More...
 
- Public Member Functions inherited from ILIAS\Refinery\Transformation
 transform ($from)
 Perform the transformation. More...
 
 __invoke ($from)
 Transformations should be callable. More...
 

Additional Inherited Members

- Protected Member Functions inherited from ILIAS\Refinery\Custom\Constraint
 getLngClosure ()
 Get the closure to be passed to the error-function that does i18n and sprintf. More...
 
- Protected Attributes inherited from ILIAS\Refinery\Custom\Constraint
 $data_factory
 
 $lng
 
 $is_ok
 
 $error
 

Detailed Description

Definition at line 11 of file IsNumeric.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Refinery\Numeric\IsNumeric::__construct ( Data\Factory  $data_factory,
\ilLanguage  $lng 
)

Definition at line 13 of file IsNumeric.php.

References ILIAS\Refinery\Custom\Constraint\$data_factory, ILIAS\Refinery\Custom\Constraint\$lng, $txt, and ILIAS\GlobalScreen\Provider\__construct().

14  {
16  function ($value) {
17  return is_numeric($value);
18  },
19  function ($txt, $value) {
20  if ('' === $value) {
21  return $txt("not_numeric_empty_string");
22  }
23 
24  return $txt("not_numeric", $value);
25  },
27  $lng
28  );
29  }
$txt
Definition: error.php:13
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

The documentation for this class was generated from the following file: