ILIAS  trunk Revision v11.0_alpha-1866-gfa368f7776e
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ILIAS\Refinery\Logical\Parallel Class Reference
+ Inheritance diagram for ILIAS\Refinery\Logical\Parallel:
+ Collaboration diagram for ILIAS\Refinery\Logical\Parallel:

Public Member Functions

 __construct (array $constraints, Data\Factory $data_factory, \ILIAS\Language\Language $lng)
 
- 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...
 
 __invoke ($from)
 Transformations should be callable. More...
 

Protected Attributes

array $failed_constraints
 

Detailed Description

Definition at line 26 of file Parallel.php.

Constructor & Destructor Documentation

◆ __construct()

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

Definition at line 41 of file Parallel.php.

References $lng, $messages, $txt, and ILIAS\GlobalScreen\Provider\__construct().

42  {
44  function ($value) use ($constraints): bool {
45  $ret = true;
46  $this->failed_constraints = [];
47  foreach ($constraints as $constraint) {
48  if (!$constraint->accepts($value)) {
49  $this->failed_constraints[] = $constraint;
50  $ret = false;
51  }
52  }
53 
54  return $ret;
55  },
56  function ($txt, $value): string {
57  $messages = [];
58  foreach ($this->failed_constraints as $constraint) {
59  $messages[] = $constraint->getErrorMessage($value);
60  }
61 
62  return implode(" ", $messages);
63  },
64  $data_factory,
65  $lng
66  );
67  }
$messages
Definition: xapiexit.php:21
$txt
Definition: error.php:31
__construct(Container $dic, ilPlugin $plugin)
global $lng
Definition: privfeed.php:31
+ Here is the call graph for this function:

Field Documentation

◆ $failed_constraints

array ILIAS\Refinery\Logical\Parallel::$failed_constraints
protected

Definition at line 34 of file Parallel.php.


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