8000 [DI][DX] Do not map id to class for global classes by ogizanagi · Pull Request #21453 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[DI][DX] Do not map id to class for global classes #21453

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
Jan 29, 2017
Merged

[DI][DX] Do not map id to class for global classes #21453

merged 1 commit into from
Jan 29, 2017

Conversation

ogizanagi
Copy link
Contributor
@ogizanagi ogizanagi commented Jan 29, 2017
Q A
Branch? master
Bug fix? yesish
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #21380
License MIT
Doc PR N/A

Using a global classname as service id without specifying the definition class attribute won't work anymore after this, in the benefit of properly throwing an exception at compilation time for a misconfigured service. Service ids could previously be wrongly interpreted as a class name.

So:

services:
    app_bar:
        arguments: ['foo']

will now properly result into:

Fatal error: Uncaught Symfony\Component\DependencyInjection\Exception\RuntimeException: The definition for "app_bar" has no class.

at compilation time.

@carsonbot carsonbot added Status: Needs Review DependencyInjection DX DX = Developer eXperience (anything that improves the experience of using Symfony) Bug labels Jan 29, 2017
@nicolas-grekas
Copy link
Member

👍 looks sensible to me

@xabbuh
Copy link
Member
xabbuh commented Jan 29, 2017

👍

Copy link
Contributor
@theofidry theofidry left a comment