From 8877a013d78b5e8132f4cadcfa64cef4f4b0c7f5 Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Wed, 21 Aug 2019 16:37:38 +0200 Subject: [PATCH] Backported return type violation bugfixes. --- .../Validator/EventListener/ValidationListenerTest.php | 3 ++- src/Symfony/Component/Form/Tests/Fixtures/FooType.php | 1 + .../Component/Security/Core/Encoder/EncoderAwareInterface.php | 2 +- src/Symfony/Component/Security/Core/User/User.php | 1 + 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/Form/Tests/Extension/Validator/EventListener/ValidationListenerTest.php b/src/Symfony/Component/Form/Tests/Extension/Validator/EventListener/ValidationListenerTest.php index 76bc07b2ee..45a0d7337d 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Validator/EventListener/ValidationListenerTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Validator/EventListener/ValidationListenerTest.php @@ -26,6 +26,7 @@ use Symfony\Component\Form\FormFactoryBuilder; use Symfony\Component\Form\FormFactoryInterface; use Symfony\Component\Validator\ConstraintViolation; use Symfony\Component\Validator\ConstraintViolationInterface; +use Symfony\Component\Validator\ConstraintViolationList; use Symfony\Component\Validator\Context\ExecutionContextInterface; use Symfony\Component\Validator\Validation; use Symfony\Component\Validator\Validator\ValidatorInterface; @@ -166,7 +167,7 @@ class DummyValidator implements ValidatorInterface public function validate($value, $constraints = null, $groups = null) { - return [$this->violation]; + return new ConstraintViolationList([$this->violation]); } public function validateProperty($object, $propertyName, $groups = null) diff --git a/src/Symfony/Component/Form/Tests/Fixtures/FooType.php b/src/Symfony/Component/Form/Tests/Fixtures/FooType.php index 2e144ad0bd..3a95172285 100644 --- a/src/Symfony/Component/Form/Tests/Fixtures/FooType.php +++ b/src/Symfony/Component/Form/Tests/Fixtures/FooType.php @@ -17,5 +17,6 @@ class FooType extends AbstractType { public function getParent() { + return null; } } diff --git a/src/Symfony/Component/Security/Core/Encoder/EncoderAwareInterface.php b/src/Symfony/Component/Security/Core/Encoder/EncoderAwareInterface.php index 22ae820cce..546f4f7337 100644 --- a/src/Symfony/Component/Security/Core/Encoder/EncoderAwareInterface.php +++ b/src/Symfony/Component/Security/Core/Encoder/EncoderAwareInterface.php @@ -22,7 +22,7 @@ interface EncoderAwareInterface * If the method returns null, the standard way to retrieve the encoder * will be used instead. * - * @return string + * @return string|null */ public function getEncoderName(); } diff --git a/src/Symfony/Component/Security/Core/User/User.php b/src/Symfony/Component/Security/Core/User/User.php index 5998ec2966..54e56d930c 100644 --- a/src/Symfony/Component/Security/Core/User/User.php +++ b/src/Symfony/Component/Security/Core/User/User.php @@ -69,6 +69,7 @@ final class User implements AdvancedUserInterface */ public function getSalt() { + return null; } /**