Skip to content

Commit 12965fa

Browse files
chadyredjaviereguiluz
authored andcommitted
[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.
1 parent 21f304b commit 12965fa

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)