public function guessMinLengthForConstraint(Constraint $constraint)
    {
        switch (get_class($constraint)) {
            case 'Symfony\Component\Validator\Constraints\Length':
                if (is_numeric($constraint->min)) {
                    return new ValueGuess($constraint->min, Guess::HIGH_CONFIDENCE);
                }
                break;
            case 'Symfony\Component\Validator\Constraints\Type':
                if (in_array($constraint->type, array('double', 'float', 'numeric', 'real'))) {
                    return new ValueGuess(null, Guess::MEDIUM_CONFIDENCE);
                }
                break;
            case 'Symfony\Component\Validator\Constraints\Range':
                if (is_numeric($constraint->min)) {
                    return new ValueGuess(strlen((string) $constraint->min), Guess::LOW_CONFIDENCE);
                }
                break;
        }
    }
public function guessMinLengthForConstraint(Constraint $constraint)
    {
        switch (get_class($constraint)) {
            case 'Symfony\Component\Validator\Constraints\Length':
                if (is_numeric($constraint->min)) {
                    return new ValueGuess($constraint->min, Guess::HIGH_CONFIDENCE);
                }
                break;
            case 'Symfony\Component\Validator\Constraints\Type':
                if (in_array($constraint->type, array('double', 'float', 'numeric', 'real'))) {
                    return new ValueGuess(null, Guess::MEDIUM_CONFIDENCE);
                }
                break;
            case 'Symfony\Component\Validator\Constraints\Range':
                if (is_numeric($constraint->min)) {
                    return new ValueGuess(strlen((string) $constraint->min), Guess::LOW_CONFIDENCE);
                }
                break;
        }
    }
public function guessMinLengthForConstraint ( Constraint $ constraint ) { switch ( get_class ( $ constraint ) ) { case 'Symfony\Component\Validator\Constraints\Length' : if ( is_numeric ( $ constraint -> min ) ) { return new ValueGuess ( $ constraint -> min , Guess :: HIGH_CONFIDENCE ) ; } break ; case 'Symfony\Component\Validator\Constraints\Type' : if ( in_array ( $ constraint -> type , array ( 'double' , 'float' , 'numeric' , 'real' ) ) ) { return new ValueGuess ( null , Guess :: MEDIUM_CONFIDENCE ) ; } break ; case 'Symfony\Component\Validator\Constraints\Range' : if ( is_numeric ( $ constraint -> min ) ) { return new ValueGuess ( strlen ( ( string ) $ constraint -> min ) , Guess :: LOW_CONFIDENCE ) ; } break ; } }
Guesses a field's minimum length based on the given constraint.

@param Constraint $constraint The constraint to guess for

@return ValueGuess|null The guess for the minimum length
Guesses a field s minimum length based on the given constraint .