ILIAS  trunk Revision v12.0_alpha-377-g3641b37b9db
Sequential.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
23use ILIAS\Refinery\Custom\Constraint as CustomConstraint;
25use ILIAS\Data;
26
27class Sequential extends CustomConstraint
28{
34
38 public function __construct(array $constraints, Data\Factory $data_factory, \ILIAS\Language\Language $lng)
39 {
41 function ($value) use ($constraints): bool {
42 foreach ($constraints as $constraint) {
43 if (!$constraint->accepts($value)) {
44 $this->failed_constraint = $constraint;
45 return false;
46 }
47 }
48
49 return true;
50 },
51 function ($txt, $value): string {
52 return $this->failed_constraint->getErrorMessage($value);
53 },
54 $data_factory,
55 $lng
56 );
57 }
58}
Builds data types.
Definition: Factory.php:36
Constraint $failed_constraint
There's a test to show this state will never be visible SequentialTest::testCorrectErrorMessagesAfter...
Definition: Sequential.php:33
__construct(array $constraints, Data\Factory $data_factory, \ILIAS\Language\Language $lng)
Definition: Sequential.php:38
A constraint encodes some resrtictions on values.
Definition: Constraint.php:32
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.
global $lng
Definition: privfeed.php:31