symfony/symfony — pull request #6580 by bschussek (2013-01-05 17:50:20+00:00)
Title: [Form] Protected methods in FormConfigBuilder and FormBuilder

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -
License of the code: MIT
Documentation PR: -

When a form is created, a `FormConfigInterface` instance is passed to the constructor of `Form` and then accessible via `getConfig()`. For performance reasons, `FormBuilder` also implements `FormConfigInterface` and is passed here directly instead of copying its values to a new `FormConfig` instance, although protected from further modifications.

This PR adds guard clauses not only to the setters, but also to the getters of `FormBuilder` to prevent misuse of the "config" object giving unexpected results.

Additionally, this PR introduces first improvements of the form's `Exception\` namespace as described in #6549.