Skip to content

Commit 623bb12

Browse files
committed
minor #19405 [Doctrine] Automapping validation example seems broken (chadyred)
This PR was submitted for the 7.1 branch but it was merged into the 6.3 branch instead. Discussion ---------- [Doctrine] Automapping validation example seems broken As the type hinting from setter is available, this example will not work (and not nullable in that case, it is not possible to run this example with the doc context) 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. Commits ------- 12965fa [Doctrine] Update doctrine.rst
2 parents 21f304b + 12965fa commit 623bb12

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

doctrine.rst

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -448,12 +448,6 @@ Consider the following controller code::
448448
public function createProduct(ValidatorInterface $validator): Response
449449
{
450450
$product = new Product();
451-
// This will trigger an error: the column isn't nullable in the database
452-
$product->setName(null);
453-
// This will trigger a type mismatch error: an integer is expected
454-
$product->setPrice('1999');
455-
456-
// ...
457451

458452
$errors = $validator->validate($product);
459453
if (count($errors) > 0) {

0 commit comments

Comments
 (0)