ILIAS  release_8 Revision v8.24
ILIAS\Refinery\Logical\Sequential Class Reference
+ Inheritance diagram for ILIAS\Refinery\Logical\Sequential:
+ Collaboration diagram for ILIAS\Refinery\Logical\Sequential:

Public Member Functions

 __construct (array $constraints, 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)
 @inheritDoc More...
 
 accepts ($value)
 @inheritDoc More...
 
 problemWith ($value)
 @inheritDoc More...
 
 applyTo (Result $result)
 @inheritDoc More...
 
- Public Member Functions inherited from ILIAS\Refinery\Constraint
 check ($value)
 Checks the provided value. More...
 
 accepts ($value)
 Tells if the provided value complies. More...
 
 problemWith ($value)
 Tells what the problem with the provided value is. More...
 
 applyTo (Result $result)
 Restricts a Result. More...
 
 withProblemBuilder (callable $builder)
 Get a constraint like this one with a builder for a custom error message. More...
 
- Public Member Functions inherited from ILIAS\Refinery\Transformation
 transform ($from)
 Perform the transformation. More...
 
 applyTo (Result $result)
 Perform the transformation and reify possible failures. More...
 
 __invoke ($from)
 Transformations should be callable. More...
 

Private Attributes

Constraint $failed_constraint
 

Additional Inherited Members

- Protected Member Functions inherited from ILIAS\Refinery\Custom\Constraint
 getError ()
 @inheritDoc More...
 
- Protected Attributes inherited from ILIAS\Refinery\Custom\Constraint
Data Factory $data_factory
 
ilLanguage $lng
 
 $is_ok
 
 $error
 

Detailed Description

Definition at line 28 of file Sequential.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Refinery\Logical\Sequential::__construct ( array  $constraints,
Data\Factory  $data_factory,
ilLanguage  $lng 
)
Parameters
Constraint[]$constraints
Data\Factory$data_factory
ilLanguage$lng

Definition at line 43 of file Sequential.php.

44 {
46 function ($value) use ($constraints): bool {
47 foreach ($constraints as $constraint) {
48 if (!$constraint->accepts($value)) {
49 $this->failed_constraint = $constraint;
50 return false;
51 }
52 }
53
54 return true;
55 },
56 function ($txt, $value): string {
57 return $this->failed_constraint->getErrorMessage($value);
58 },
60 $lng
61 );
62 }
$txt
Definition: error.php:13
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

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

+ Here is the call graph for this function:

Field Documentation

◆ $failed_constraint

Constraint ILIAS\Refinery\Logical\Sequential::$failed_constraint
private

Definition at line 36 of file Sequential.php.


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