Skip to content

Commit a0af554

Browse files
[Validator] Improve return types in tests
1 parent 3c016e0 commit a0af554

File tree

56 files changed

+64
-110
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+64
-110
lines changed

Tests/Constraints/AllValidatorTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,12 @@
1515
use Symfony\Component\Validator\Constraints\AllValidator;
1616
use Symfony\Component\Validator\Constraints\NotNull;
1717
use Symfony\Component\Validator\Constraints\Range;
18-
use Symfony\Component\Validator\ConstraintValidatorInterface;
1918
use Symfony\Component\Validator\Exception\UnexpectedValueException;
2019
use Symfony\Component\Validator\Test\ConstraintValidatorTestCase;
2120

2221
class AllValidatorTest extends ConstraintValidatorTestCase
2322
{
24-
protected function createValidator(): ConstraintValidatorInterface
23+
protected function createValidator(): AllValidator
2524
{
2625
return new AllValidator();
2726
}

Tests/Constraints/AtLeastOneOfValidatorTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
use Symfony\Component\Validator\Constraints\Regex;
3232
use Symfony\Component\Validator\Constraints\Unique;
3333
use Symfony\Component\Validator\Constraints\Valid;
34-
use Symfony\Component\Validator\ConstraintValidatorInterface;
3534
use Symfony\Component\Validator\ConstraintViolation;
3635
use Symfony\Component\Validator\Mapping\ClassMetadata;
3736
use Symfony\Component\Validator\Mapping\Factory\MetadataFactoryInterface;
@@ -44,7 +43,7 @@
4443
*/
4544
class AtLeastOneOfValidatorTest extends ConstraintValidatorTestCase
4645
{
47-
protected function createValidator(): ConstraintValidatorInterface
46+
protected function createValidator(): AtLeastOneOfValidator
4847
{
4948
return new AtLeastOneOfValidator();
5049
}

Tests/Constraints/BicValidatorTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
use Symfony\Component\Validator\Constraints\Bic;
1515
use Symfony\Component\Validator\Constraints\BicValidator;
16-
use Symfony\Component\Validator\ConstraintValidatorInterface;
1716
use Symfony\Component\Validator\Exception\ConstraintDefinitionException;
1817
use Symfony\Component\Validator\Exception\UnexpectedValueException;
1918
use Symfony\Component\Validator\Mapping\ClassMetadata;
@@ -22,7 +21,7 @@
2221

2322
class BicValidatorTest extends ConstraintValidatorTestCase
2423
{
25-
protected function createValidator(): ConstraintValidatorInterface
24+
protected function createValidator(): BicValidator
2625
{
2726
return new BicValidator();
2827
}

Tests/Constraints/BlankValidatorTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,11 @@
1313

1414
use Symfony\Component\Validator\Constraints\Blank;
1515
use Symfony\Component\Validator\Constraints\BlankValidator;
16-
use Symfony\Component\Validator\ConstraintValidatorInterface;
1716
use Symfony\Component\Validator\Test\ConstraintValidatorTestCase;
1817

1918
class BlankValidatorTest extends ConstraintValidatorTestCase
2019
{
21-
protected function createValidator(): ConstraintValidatorInterface
20+
protected function createValidator(): BlankValidator
2221
{
2322
return new BlankValidator();
2423
}

Tests/Constraints/CallbackValidatorTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
use Symfony\Component\Validator\Constraint;
1515
use Symfony\Component\Validator\Constraints\Callback;
1616
use Symfony\Component\Validator\Constraints\CallbackValidator;
17-
use Symfony\Component\Validator\ConstraintValidatorInterface;
1817
use Symfony\Component\Validator\Context\ExecutionContextInterface;
1918
use Symfony\Component\Validator\Exception\ConstraintDefinitionException;
2019
use Symfony\Component\Validator\Test\ConstraintValidatorTestCase;
@@ -48,7 +47,7 @@ public static function validateStatic($object, ExecutionContextInterface $contex
4847

4948
class CallbackValidatorTest extends ConstraintValidatorTestCase
5049
{
51-
protected function createValidator(): ConstraintValidatorInterface
50+
protected function createValidator(): CallbackValidator
5251
{
5352
return new CallbackValidator();
5453
}

Tests/Constraints/CardSchemeValidatorTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,11 @@
1313

1414
use Symfony\Component\Validator\Constraints\CardScheme;
1515
use Symfony\Component\Validator\Constraints\CardSchemeValidator;
16-
use Symfony\Component\Validator\ConstraintValidatorInterface;
1716
use Symfony\Component\Validator\Test\ConstraintValidatorTestCase;
1817

1918
class CardSchemeValidatorTest extends ConstraintValidatorTestCase
2019
{
21-
protected function createValidator(): ConstraintValidatorInterface
20+
protected function createValidator(): CardSchemeValidator
2221
{
2322
return new CardSchemeValidator();
2423
}

Tests/Constraints/ChoiceValidatorTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
use Symfony\Component\Validator\Constraints\Choice;
1515
use Symfony\Component\Validator\Constraints\ChoiceValidator;
16-
use Symfony\Component\Validator\ConstraintValidatorInterface;
1716
use Symfony\Component\Validator\Exception\ConstraintDefinitionException;
1817
use Symfony\Component\Validator\Exception\UnexpectedValueException;
1918
use Symfony\Component\Validator\Test\ConstraintValidatorTestCase;
@@ -25,7 +24,7 @@ function choice_callback()
2524

2625
class ChoiceValidatorTest extends ConstraintValidatorTestCase
2726
{
28-
protected function createValidator(): ConstraintValidatorInterface
27+
protected function createValidator(): ChoiceValidator
2928
{
3029
return new ChoiceValidator();
3130
}

Tests/Constraints/CollectionValidatorTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,12 @@
1717
use Symfony\Component\Validator\Constraints\Optional;
1818
use Symfony\Component\Validator\Constraints\Range;
1919
use Symfony\Component\Validator\Constraints\Required;
20-
use Symfony\Component\Validator\ConstraintValidatorInterface;
2120
use Symfony\Component\Validator\Exception\UnexpectedValueException;
2221
use Symfony\Component\Validator\Test\ConstraintValidatorTestCase;
2322

2423
abstract class CollectionValidatorTest extends ConstraintValidatorTestCase
2524
{
26-
protected function createValidator(): ConstraintValidatorInterface
25+
protected function createValidator(): CollectionValidator
2726
{
2827
return new CollectionValidator();
2928
}

Tests/Constraints/CompoundValidatorTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,11 @@
1515
use Symfony\Component\Validator\Constraints\CompoundValidator;
1616
use Symfony\Component\Validator\Constraints\Length;
1717
use Symfony\Component\Validator\Constraints\NotBlank;
18-
use Symfony\Component\Validator\ConstraintValidatorInterface;
1918
use Symfony\Component\Validator\Test\ConstraintValidatorTestCase;
2019

2120
class CompoundValidatorTest extends ConstraintValidatorTestCase
2221
{
23-
protected function createValidator(): ConstraintValidatorInterface
22+
protected function createValidator(): CompoundValidator
2423
{
2524
return new CompoundValidator();
2625
}

Tests/Constraints/CountValidatorTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
use Symfony\Component\Validator\Constraints\Count;
1515
use Symfony\Component\Validator\Constraints\CountValidator;
1616
use Symfony\Component\Validator\Constraints\DivisibleBy;
17-
use Symfony\Component\Validator\ConstraintValidatorInterface;
1817
use Symfony\Component\Validator\Exception\UnexpectedValueException;
1918
use Symfony\Component\Validator\Test\ConstraintValidatorTestCase;
2019

@@ -23,7 +22,7 @@
2322
*/
2423
abstract class CountValidatorTest extends ConstraintValidatorTestCase
2524
{
26-
protected function createValidator(): ConstraintValidatorInterface
25+
protected function createValidator(): CountValidator
2726
{
2827
return new CountValidator();
2928
}

0 commit comments

Comments
 (0)