final class Validation{ /**
* Creates a callable chain of constraints.
*/
public static function createCallable(Constraint|ValidatorInterface
$constraintOrValidator = null, Constraint ...
$constraints): callable
{ $validator = self::
createIsValidCallable($constraintOrValidator, ...
$constraints);
return static function D
$value) use ($validator) { if (!
$validator($value,
$violations)) { throw new ValidationFailedException($value,
$violations);
} return $value;
};
} /**
* Creates a callable that returns true/false instead of throwing validation exceptions.
*
* @return callable(mixed $value, ConstraintViolationListInterface &$violations = null): bool
*/