19declare(strict_types=1);
37use InvalidArgumentException;
43 private readonly
Factory $dataFactory,
160 if (is_array($classNameOrArray)) {
161 if (2 !== count($classNameOrArray)) {
162 throw new InvalidArgumentException(
'The array MUST contain exactly two elements');
176 return $this->
toNew([$this->dataFactory, $dataType]);
193 return new InArrayTransformation($valid_members, $this->
language);
int()
Returns an object that allows to transform a value to an integer value.
bool()
Returns an object that allows to transform a value to a boolean value.
string()
Returns an object that allows to transform a value to a string value.
recordOf(array $transformations)
Returns an object that allows to transform the values of an associative array with the given associat...
listOf(Transformation $transformation)
Returns an object that allows to transform an value in a given array with the given transformation ob...
float()
Returns an object that allows to transform a value to a float value.
toNew($classNameOrArray)
Returns either an transformation object to create objects of an existing class, with variations of co...
__construct(private readonly Factory $dataFactory, private readonly Language $language)
tupleOf(array $transformation)
Returns an object that allows to transform the values of an array with the given array of transformat...
inArray(array $valid_members)
Validates that the value to be transformed is in the set given to this transformation.
dictOf(Transformation $transformation)
Returns an object that allows to transform the values of an associative array with the given transfor...