8000 remove deprecated constraints calls (Min, Max, MaxLength, MinLength) · symfony/symfony@f232550 · GitHub
[go: up one dir, main page]

Skip to content

Commit f232550

Browse files
committed
remove deprecated constraints calls (Min, Max, MaxLength, MinLength)
1 parent b0687c8 commit f232550

File tree

1 file changed

+0
-16
lines changed

1 file changed

+0
-16
lines changed

src/Symfony/Component/Form/Extension/Validator/ValidatorTypeGuesser.php

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -145,14 +145,10 @@ public function guessTypeForConstraint(Constraint $constraint)
145145
case 'Symfony\Component\Validator\Constraints\Ip':
146146
return new TypeGuess('text', array(), Guess::MEDIUM_CONFIDENCE);
147147

148-
case 'Symfony\Component\Validator\Constraints\MaxLength':
149-
case 'Symfony\Component\Validator\Constraints\MinLength':
150148
case 'Symfony\Component\Validator\Constraints\Length':
151149
case 'Symfony\Component\Validator\Constraints\Regex':
152150
return new TypeGuess('text', array(), Guess::LOW_CONFIDENCE);
153151

154-
case 'Symfony\Component\Validator\Constraints\Min':
155-
case 'Symfony\Component\Validator\Constraints\Max':
156152
case 'Symfony\Component\Validator\Constraints\Range':
157153
return new TypeGuess('number', array(), Guess::LOW_CONFIDENCE);
158154

@@ -197,9 +193,6 @@ public function guessRequiredForConstraint(Constraint $constraint)
197193
public function guessMaxLengthForConstraint(Constraint $constraint)
198194
{
199195
switch (get_class($constraint)) {
200-
case 'Symfony\Component\Validator\Constraints\MaxLength':
201-
return new ValueGuess($constraint->limit, Guess::HIGH_CONFIDENCE);
202-
203196
case 'Symfony\Component\Validator\Constraints\Length':
204197
if (is_numeric($constraint->max)) {
205198
return new ValueGuess($constraint->max, Guess::HIGH_CONFIDENCE);
@@ -212,9 +205,6 @@ public function guessMaxLengthForConstraint(Constraint $constraint)
212205
}
213206
break;
214207

215-
case 'Symfony\Component\Validator\Constraints\Max':
216-
return new ValueGuess(strlen((string) $constraint->limit), Guess::LOW_CONFIDENCE);
217-
218208
case 'Symfony\Component\Validator\Constraints\Range':
219209
if (is_numeric($constraint->max)) {
220210
return new ValueGuess(strlen((string) $constraint->max), Guess::LOW_CONFIDENCE);
@@ -235,9 +225,6 @@ public function guessMaxLengthForConstraint(Constraint $constraint)
235225
public function guessPatternForConstraint(Constraint $constraint)
236226
{
237227
switch (get_class($constraint)) {
238-
case 'Symfony\Component\Validator\Constraints\MinLength':
239-
return new ValueGuess(sprintf('.{%s,}', (string) $constraint->limit), Guess::LOW_CONFIDENCE);
240-
241228
case 'Symfony\Component\Validator\Constraints\Length':
242229
if (is_numeric($constraint->min)) {
243230
return new ValueGuess(sprintf('.{%s,}', (string) $constraint->min), Guess::LOW_CONFIDENCE);
@@ -252,9 +239,6 @@ public function guessPatternForConstraint(Constraint $constraint)
252239
}
253240
break;
254241

255-
case 'Symfony\Component\Validator\Constraints\Min':
256-
return new ValueGuess(sprintf('.{%s,}', strlen((string) $constraint->limit)), Guess::LOW_CONFIDENCE);
257-
258242
case 'Symfony\Component\Validator\Constraints\Range':
259243
if (is_numeric($constraint->min)) {
260244
return new ValueGuess(sprintf('.{%s,}', strlen((string) $constraint->min)), Guess::LOW_CONFIDENCE);

0 commit comments

Comments
 (0)
0