8000 [Form] Added exception when setAutoInitialize() is called when locked by jaytaph · Pull Request #15682 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Form] Added exception when setAutoInitialize() is called when locked #15682

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Added exception when setAutoInitialize is called when locked
  • Loading branch information
jaytaph committed Sep 3, 2015
commit 7eaeb69032e7b82f68869069b586f8dd0b60ae4d
4 changes: 4 additions & 0 deletions src/Symfony/Component/Form/FormConfigBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -854,6 +854,10 @@ public function setRequestHandler(RequestHandlerInterface $requestHandler)
*/
public function setAutoInitialize($initialize)
{
if ($this->locked) {
throw new BadMethodCallException('FormConfigBuilder methods cannot be accessed anymore once the builder is turned into a FormConfigInterface instance.');
}

$this->autoInitialize = (bool) $initialize;

return $this;
Expand Down
0