original_string: public function guessMaxLengthForConstraint(Constraint $constraint)
      {
          switch (\get_class($constraint)) {
              case 'Symfony\Component\Validator\Constraints\Length':
                  if (is_numeric($constraint->max)) {
                      return new ValueGuess($constraint->max, Guess::HIGH_CONFIDENCE);
                  }
                  break;
  
              case 'Symfony\Component\Validator\Constraints\Type':
                  if (\in_array($constraint->type, ['double', 'float', 'numeric', 'real'])) {
                      return new ValueGuess(null, Guess::MEDIUM_CONFIDENCE);
                  }
                  break;
  
              case 'Symfony\Component\Validator\Constraints\Range':
                  if (is_numeric($constraint->max)) {
                      return new ValueGuess(\strlen((string) $constraint->max), Guess::LOW_CONFIDENCE);
                  }
                  break;
          }
      }
code: public function guessMaxLengthForConstraint(Constraint $constraint)
      {
          switch (\get_class($constraint)) {
              case 'Symfony\Component\Validator\Constraints\Length':
                  if (is_numeric($constraint->max)) {
                      return new ValueGuess($constraint->max, Guess::HIGH_CONFIDENCE);
                  }
                  break;
  
              case 'Symfony\Component\Validator\Constraints\Type':
                  if (\in_array($constraint->type, ['double', 'float', 'numeric', 'real'])) {
                      return new ValueGuess(null, Guess::MEDIUM_CONFIDENCE);
                  }
                  break;
  
              case 'Symfony\Component\Validator\Constraints\Range':
                  if (is_numeric($constraint->max)) {
                      return new ValueGuess(\strlen((string) $constraint->max), Guess::LOW_CONFIDENCE);
                  }
                  break;
          }
      }
code_tokens: public function guessMaxLengthForConstraint ( Constraint $ constraint ) { switch ( \ get_class ( $ constraint ) ) { case 'Symfony\Component\Validator\Constraints\Length' : if ( is_numeric ( $ constraint -> max ) ) { return new ValueGuess ( $ constraint -> max , Guess :: HIGH_CONFIDENCE ) ; } break ; case 'Symfony\Component\Validator\Constraints\Type' : if ( \ in_array ( $ constraint -> type , [ 'double' , 'float' , 'numeric' , 'real' ] ) ) { return new ValueGuess ( null , Guess :: MEDIUM_CONFIDENCE ) ; } break ; case 'Symfony\Component\Validator\Constraints\Range' : if ( is_numeric ( $ constraint -> max ) ) { return new ValueGuess ( \ strlen ( ( string ) $ constraint -> max ) , Guess :: LOW_CONFIDENCE ) ; } break ; } }
docstring: Guesses a field's maximum length based on the given constraint.
  
  @return ValueGuess|null The guess for the maximum length
docstring_tokens: Guesses a field s maximum length based on the given constraint .