Skip to content

Commit db91042

Browse files
committed
minor symfony#31222 [Form] Add Button type back to Form::getClickedButton docblock (Bill Hance)
This PR was merged into the 3.4 branch. Discussion ---------- [Form] Add Button type back to Form::getClickedButton docblock | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | In commit 56429a6 the `Button` type was removed from the return doc block. I suspect this was an oversight because, AFAIK, the [recommended way](https://symfony.com/doc/current/form/multiple_buttons.html) to check the name of a clicked button would require a return type of `Button` or `SubmitButton`. The effect is that our static analysis checks are failing. ``` Call to an undefined method Symfony\Component\Form\ClickableInterface::getName(). ``` Commits ------- b71d589 Added FormInterface to @return Form::getClickedButton docblock
2 parents 07ca9f4 + b71d589 commit db91042

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Symfony/Component/Form/Form.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ class Form implements \IteratorAggregate, FormInterface
8989
private $submitted = false;
9090

9191
/**
92-
* @var ClickableInterface|null The button that was used to submit the form
92+
* @var FormInterface|ClickableInterface|null The button that was used to submit the form
9393
*/
9494
private $clickedButton;
9595

@@ -749,7 +749,7 @@ public function isValid()
749749
/**
750750
* Returns the button that was used to submit the form.
751751
*
752-
* @return ClickableInterface|null
752+
* @return FormInterface|ClickableInterface|null
753753
*/
754754
public function getClickedButton()
755755
{

0 commit comments

Comments
 (0)