2 declare(strict_types=1);
31 foreach ($transformations as $transformation) {
33 $transformationClassName = Transformation::class;
36 sprintf(
'The array MUST contain only "%s" instances', $transformationClassName),
37 'not_a_transformation',
38 $transformationClassName
54 foreach ($from as $key => $value) {
55 if (
false === array_key_exists($key, $this->transformations)) {
58 'There is no entry "%s" defined in the transformation array',
61 'values_do_not_match',
65 $transformedValue = $this->transformations[$key]->transform($value);
78 $countOfValues = count($values);
79 $countOfTransformations = count($this->transformations);
81 if ($countOfValues !== $countOfTransformations) {
84 'The given values(count: "%s") does not match with the given transformations("%s")',
86 $countOfTransformations
90 $countOfTransformations
trait DeriveApplyToFromTransform
trait DeriveInvokeFromTransform