8000 [Validator] Improve return types in tests · jschaedl/symfony@2eed84b · GitHub
[go: up one dir, main page]

Skip to content

Commit 2eed84b

Browse files
com 10000 mitted
[Validator] Improve return types in tests
1 parent 36e240c commit 2eed84b

File tree

58 files changed

+66
-113
lines changed

Some content is hidden

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

58 files changed

+66
-113
lines changed

src/Symfony/Component/Form/Tests/Extension/Validator/Constraints/FormValidatorTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
use Symfony\Component\Validator\Constraints\NotBlank;
3131
use Symfony\Component\Validator\Constraints\NotNull;
3232
use Symfony\Component\Validator\Constraints\Valid;
33-
use Symfony\Component\Validator\ConstraintValidatorInterface;
3433
use Symfony\Component\Validator\Context\ExecutionContext;
3534
use Symfony\Component\Validator\Test\ConstraintValidatorTestCase;
3635
use Symfony\Component\Validator\Validation;
@@ -715,7 +714,7 @@ public function testCauseForNotAllowedExtraFieldsIsTheFormConstraint()
715714
$this->assertSame($constraint, $context->getViolations()->get(0)->getConstraint());
716715
}
717716

718-
protected function createValidator(): ConstraintValidatorInterface
717+
protected function createValidator(): FormValidator
719718
{
720719
return new FormValidator();
721720
}

src/Symfony/Component/Security/Core/Tests/Validator/Constraints/UserPasswordValidatorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ abstract class UserPasswordValidatorTest extends ConstraintValidatorTestCase
4545
*/
4646
protected $hasherFactory;
4747

48-
protected function createValidator(): ConstraintValidatorInterface
48+
protected function createValidator(): UserPasswordValidator
4949
{
5050
return new UserPasswordValidator($this->tokenStorage, $this->hasherFactory);
5151
}

src/Symfony/Component/Validator/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
}

src/Symfony/Component/Validator/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
}

src/Symfony/Component/Validator/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
}

src/Symfony/Component/Validator/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
}

src/Symfony/Component/Validator/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
}

src/Symfony/Component/Validator/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
}

src/Symfony/Component/Validator/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
}

src/Symfony/Component/Validator/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
}

0 commit comments

Comments
 (0)
0