Skip to content

[FrameworkBundle][Form] Better exception message for private form tagged services #16419

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

Merged
merged 1 commit into from
Nov 5, 2015
Merged

[FrameworkBundle][Form] Better exception message for private form tagged services #16419

merged 1 commit into from
Nov 5, 2015

Conversation

ogizanagi
Copy link
Contributor

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets -
License MIT
Doc PR -

Similar to what is done in RegisterListenerPass, those changes allow to have a better exception message when defining a private form.type, form.type_extension or form.form_guesser tagged service, and at container compilation instead of runtime:

The service "my.form.type" must be public as form types are lazy-loaded.

instead of:

You have requested a non-existent service "my.form.type"

If I'm right, similar cases were considered as new features in the past, so this targets 2.8.

@linaori
Copy link
Contributor

linaori commented Nov 2, 2015

This is not a feature, this is simply a better error message which imo falls under a bug-fix. This could in theory even be merged back into 2.3 and would also be valuable in 2.7.

@javiereguiluz
Copy link
Member

👍 a very nice error message improvement

@fabpot
Copy link
Member

fabpot commented Nov 4, 2015

That's not just about a better error message but a change in behavior, so that's for 2.8.

@fabpot
Copy link
Member

fabpot commented Nov 4, 2015

👍

1 similar comment
@nicolas-grekas
Copy link
Member

👍

@fabpot
Copy link
Member

fabpot commented Nov 5, 2015

Thank you @ogizanagi.

@fabpot fabpot merged commit 11d675f into symfony:2.8 Nov 5, 2015
fabpot added a commit that referenced this pull request Nov 5, 2015
…rivate form tagged services (ogizanagi)

This PR was merged into the 2.8 branch.

Discussion
----------

[FrameworkBundle][Form] Better exception message for private form tagged services

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Similar to what is done in [RegisterListenerPass](https://github.com/symfony/symfony/blob/2.8/src/Symfony/Component/EventDispatcher/DependencyInjection/RegisterListenersPass.php#L61-L63), those changes allow to have a better exception message when defining a private `form.type`, `form.type_extension` or `form.form_guesser` tagged service, and at container compilation instead of runtime:

> The service "my.form.type" must be public as form types are lazy-loaded.

instead of:
> You have requested a non-existent service "my.form.type"

If I'm right, similar cases were considered as new features in the past, so this targets 2.8.

Commits
-------

11d675f [FrameworkBundle][Form] Better exception message for private form tagged services
@ogizanagi ogizanagi deleted the fwbundle_private_form_services_exc branch November 5, 2015 16:13
@fabpot fabpot mentioned this pull request Nov 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants