8000 Added exception when setAutoInitialize is called when locked · symfony/symfony@c269d6f · GitHub
[go: up one dir, main page]

Skip to content

Commit c269d6f

Browse files
jaytaphfabpot
authored andcommitted
Added exception when setAutoInitialize is called when locked
1 parent 16ba457 commit c269d6f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Symfony/Component/Form/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)
0