Skip to content

[DependencyInjection] Deprecate autowiring service auto-registration #23712

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 3 commits into from

Conversation

GuilhemN
Copy link
Contributor

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

Fix #23350, to make autowiring more predictable.

@GuilhemN
Copy link
Contributor Author

GuilhemN commented Jul 29, 2017

@nicolas-grekas the cs issue reported by fabbot.io was done on purpose, right?

@nicolas-grekas
Copy link
Member

Right

UPGRADE-3.4.md Outdated
@@ -4,6 +4,10 @@ UPGRADE FROM 3.3 to 3.4
DependencyInjection
-------------------

* Autowiring service auto-registration is deprecated and won't be supported
in Symfony 4.0. Explicitely inject your dependencies or create services
whose ids are their fully-qualified class name.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An example with before/after would probably help people understand what that means. For anybody not familiar with the container, this is cryptic :)

Copy link
Contributor Author

@GuilhemN GuilhemN Aug 1, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed but that's a deprecation that is hard to illustrate. I added an example that I tried to make as familiar as possible :)

@xabbuh xabbuh added this to the 3.4 milestone Aug 1, 2017
Copy link
Member

@xabbuh xabbuh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the changelog file of the DependencyInjection component needs to be updated too

UPGRADE-3.4.md Outdated
@@ -4,6 +4,50 @@ UPGRADE FROM 3.3 to 3.4
DependencyInjection
-------------------

* Autowiring service auto-registration is deprecated and won't be supported
in Symfony 4.0. Explicitely inject your dependencies or create services
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Explicitly

UPGRADE-4.0.md Outdated
@@ -77,6 +77,50 @@ Debug
DependencyInjection
-------------------

* Autowiring service auto-registration is not supported anymore.
Explicitely inject your dependencies or create services whose ids are
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Explicitly

@GuilhemN
Copy link
Contributor Author

GuilhemN commented Aug 1, 2017

@xabbuh done

@nicolas-grekas
Copy link
Member

Thank you @GuilhemN.

nicolas-grekas added a commit that referenced this pull request Aug 3, 2017
…o-registration (GuilhemN)

This PR was squashed before being merged into the 3.4 branch (closes #23712).

Discussion
----------

[DependencyInjection] Deprecate autowiring service auto-registration

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no <!-- don't forget updating src/**/CHANGELOG.md files -->
| BC breaks?    | no
| Deprecations? | yes <!-- don't forget updating UPGRADE-*.md files -->
| Tests pass?   | yes
| Fixed tickets | #23350
| License       | MIT
| Doc PR        |

Fix #23350, to make autowiring more predictable.

Commits
-------

969a207 [DependencyInjection] Deprecate autowiring service auto-registration
This was referenced Oct 18, 2017
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.

7 participants