Skip to content

Commit 6da03aa

Browse files
committed
Fix comment stating isSubmitted is optional
1 parent 55812c7 commit 6da03aa

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/Controller/Admin/BlogController.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,8 @@ public function new(
8686

8787
$form->handleRequest($request);
8888

89-
// the isSubmitted() method is completely optional because the other
90-
// isValid() method already checks whether the form is submitted.
91-
// However, we explicitly add it to improve code readability.
89+
// The isSubmitted() call is mandatory because the isValid() method
90+
// throws an exception if the form has not been submitted.
9291
// See https://symfony.com/doc/current/forms.html#processing-forms
9392
if ($form->isSubmitted() && $form->isValid()) {
9493
$entityManager->persist($post);

0 commit comments

Comments
 (0)