public static function quickValidate(?string $value, array $constraints = [])
    {
        // Initialize the validator
        $validator = new static('quickValidate function', InputFieldTypes::PASSED, [], $value, null);
        // Add the constraints
        if (is_array($constraints) && count($constraints) > 0) {
            foreach ($constraints as $constraint) {
                /** @var Constraint|array $constraint */
                if (is_array($constraint) && count($constraint) > 0) {
                    $validator->addConstraint(Constraint::factory($constraint));
                } elseif (!is_array($constraint)) {
                    $validator->addConstraint($constraint);
                }
            }
        }
        // Return the value or throw an exception
        if ($validator->isValid()) {
            return $validator->getValue();
        } else {
            throw new InvalidInputException('The value is not valid.');
        }

    }