From 12965fa552f443e445db225f5759ab1848da6a3a Mon Sep 17 00:00:00 2001 From: Florian Cellier Date: Wed, 10 Jan 2024 12:53:53 +0100 Subject: [PATCH] [Doctrine] Update doctrine.rst As the type hinting from setter is available, this example will not work. Even without `declare(strict_types=1);` string which could be convert to integer will work but with it, impossible to run this example, as we will have the error "int" expected. --- doctrine.rst | 6 ------ 1 file changed, 6 deletions(-) diff --git a/doctrine.rst b/doctrine.rst index e22453db8a9..70f538e520b 100644 --- a/doctrine.rst +++ b/doctrine.rst @@ -448,12 +448,6 @@ Consider the following controller code:: public function createProduct(ValidatorInterface $validator): Response { $product = new Product(); - // This will trigger an error: the column isn't nullable in the database - $product->setName(null); - // This will trigger a type mismatch error: an integer is expected - $product->setPrice('1999'); - - // ... $errors = $validator->validate($product); if (count($errors) > 0) {