19 declare(strict_types=1);
46 foreach ($transformations as $transformation) {
48 $transformationClassName = Transformation::class;
51 sprintf(
'The array MUST contain only "%s" instances', $transformationClassName),
52 'not_a_transformation',
53 $transformationClassName
69 foreach ($from as $key => $value) {
70 $transformedValue = $this->transformations[$key]->transform($value);
71 $result[] = $transformedValue;
106 return count(array_filter($value,
function ($key):
bool {
107 if (!array_key_exists($key, $this->transformations)) {
108 $this->error = sprintf(
'There is no entry "%s" defined in the transformation array', $key);
112 }, ARRAY_FILTER_USE_KEY)) === 0;
117 $countOfValues = count($values);
118 $countOfTransformations = count($this->transformations);
120 if ($countOfValues !== $countOfTransformations) {
121 $this->error = sprintf(
122 'The given values(count: "%s") does not match with the given transformations("%s")',
124 $countOfTransformations
trait DeriveInvokeFromTransform
trait DeriveApplyToFromTransform
A constraint encodes some resrtictions on values.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null