Skip to content

Commit 0a845b5

Browse files
jaytaphfabpot
authored andcommitted
Added exception when setAutoInitialize is called when locked
1 parent 9bcbbf5 commit 0a845b5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

FormConfigBuilder.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -855,6 +855,10 @@ public function setRequestHandler(RequestHandlerInterface $requestHandler)
855855
*/
856856
public function setAutoInitialize($initialize)
857857
{
858+
if ($this->locked) {
859+
throw new BadMethodCallException('FormConfigBuilder methods cannot be accessed anymore once the builder is turned into a FormConfigInterface instance.');
860+
}
861+
858862
$this->autoInitialize = (bool) $initialize;
859863

860864
return $this;

0 commit comments

Comments
 (0)