Backported return type violation bugfixes.

This commit is contained in:
Alexander M. Turek 2019-08-21 16:37:38 +02:00
parent 50a3d64729
commit 8877a013d7
4 changed files with 5 additions and 2 deletions

View File

@ -26,6 +26,7 @@ use Symfony\Component\Form\FormFactoryBuilder;
use Symfony\Component\Form\FormFactoryInterface; use Symfony\Component\Form\FormFactoryInterface;
use Symfony\Component\Validator\ConstraintViolation; use Symfony\Component\Validator\ConstraintViolation;
use Symfony\Component\Validator\ConstraintViolationInterface; use Symfony\Component\Validator\ConstraintViolationInterface;
use Symfony\Component\Validator\ConstraintViolationList;
use Symfony\Component\Validator\Context\ExecutionContextInterface; use Symfony\Component\Validator\Context\ExecutionContextInterface;
use Symfony\Component\Validator\Validation; use Symfony\Component\Validator\Validation;
use Symfony\Component\Validator\Validator\ValidatorInterface; use Symfony\Component\Validator\Validator\ValidatorInterface;
@ -166,7 +167,7 @@ class DummyValidator implements ValidatorInterface
public function validate($value, $constraints = null, $groups = null) public function validate($value, $constraints = null, $groups = null)
{ {
return [$this->violation]; return new ConstraintViolationList([$this->violation]);
} }
public function validateProperty($object, $propertyName, $groups = null) public function validateProperty($object, $propertyName, $groups = null)

View File

@ -17,5 +17,6 @@ class FooType extends AbstractType
{ {
public function getParent() public function getParent()
{ {
return null;
} }
} }

View File

@ -22,7 +22,7 @@ interface EncoderAwareInterface
* If the method returns null, the standard way to retrieve the encoder * If the method returns null, the standard way to retrieve the encoder
* will be used instead. * will be used instead.
* *
* @return string * @return string|null
*/ */
public function getEncoderName(); public function getEncoderName();
} }

View File

@ -69,6 +69,7 @@ final class User implements AdvancedUserInterface
*/ */
public function getSalt() public function getSalt()
{ {
return null;
} }
/** /**