File tree Expand file tree Collapse file tree 2 files changed +17
-9
lines changed Expand file tree Collapse file tree 2 files changed +17
-9
lines changed Original file line number Diff line number Diff line change @@ -430,10 +430,12 @@ public function setIsEmptyCallback(?callable $isEmptyCallback)
430
430
431
431
/**
432
432
* Unsupported method.
433
+ *
434
+ * @throws BadMethodCallException
433
435
*/
434
436
public function getEventDispatcher ()
435
437
{
436
- return null ;
438
+ throw new BadMethodCallException ( ' Buttons do not support event dispatching. ' ) ;
437
439
}
438
440
439
441
/**
@@ -626,26 +628,32 @@ public function getFormFactory()
626
628
627
629
/**
628
630
* Unsupported method.
631
+ *
632
+ * @throws BadMethodCallException
629
633
*/
630
634
public function getAction ()
631
635
{
632
- return null ;
636
+ throw new BadMethodCallException ( ' Buttons do not support actions. ' ) ;
633
637
}
634
638
635
639
/**
636
640
* Unsupported method.
641
+ *
642
+ * @throws BadMethodCallException
637
643
*/
638
644
public function getMethod ()
639
645
{
640
- return null ;
646
+ throw new BadMethodCallException ( ' Buttons do not support methods. ' ) ;
641
647
}
642
648
643
649
/**
644
650
* Unsupported method.
651
+ *
652
+ * @throws BadMethodCallException
645
653
*/
646
654
public function getRequestHandler ()
647
655
{
648
- return null ;
656
+ throw new BadMethodCallException ( ' Buttons do not support request handlers. ' ) ;
649
657
}
650
658
651
659
/**
Original file line number Diff line number Diff line change @@ -88,11 +88,7 @@ class FormConfigBuilder implements FormConfigBuilderInterface
88
88
*/
89
89
private $ formFactory ;
90
90
91
- /**
92
- * @var string|null
93
- */
94
- private $ action ;
95
-
91
+ private $ action = '' ;
96
92
private $ method = 'POST ' ;
97
93
98
94
/**
@@ -396,6 +392,10 @@ public function getDataLocked()
396
392
*/
397
393
public function getFormFactory ()
398
394
{
395
+ if (!isset ($ this ->formFactory )) {
396
+ throw new BadMethodCallException ('The form factory must be set before retrieving it. ' );
397
+ }
398
+
399
399
return $ this ->formFactory ;
400
400
}
401
401
You can’t perform that action at this time.
0 commit comments