Skip to content

[DI] Service deprecation gets lost for privates #23536

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
ro0NL opened this issue Jul 16, 2017 · 4 comments
Closed

[DI] Service deprecation gets lost for privates #23536

ro0NL opened this issue Jul 16, 2017 · 4 comments

Comments

@ro0NL
Copy link
Contributor

ro0NL commented Jul 16, 2017

Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? no
Symfony version 3.2

Deprecations seem to get lost when a service is private, consider;

a:
    class: stdClass
    public: false
    deprecated: '%service_id% IS DEPRECATED'
b:
    class: stdClass
    public: true
    properties:
        a: '@a'

Calling get('b')->a works fine, however no deprecation is triggered. Making a public fixes the issue.

@ro0NL
Copy link
Contributor Author

ro0NL commented Jul 16, 2017

See ro0NL@4cb84fa for failing tests..

Im not sure we can fix this easily due inlining; perhaps settle with forcing to public for those?

@alekitto
Copy link
Contributor

Deprecations could be dumped in the container, but the only way i found requires removing check for %service_id% placeholder in Definition, otherwise the original service id will be lost after inlining.
See alekitto@2e70908 for details.

@nicolas-grekas
Copy link
Member

Can't we just disable inlining for them?

@alekitto
Copy link
Contributor

Yeah! Nice and easier solution

@xabbuh xabbuh added this to the 3.2 milestone Jul 17, 2017
fabpot added a commit that referenced this issue Jul 17, 2017
This PR was merged into the 2.8 branch.

Discussion
----------

Disable inlining deprecated services

| Q             | A
| ------------- | ---
| Branch?       | 2.8
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #23536
| License       | MIT

Deprecation errors are not triggered for inlined services.
Disabling inlining for those services will fix this issue.

Commits
-------

6ab8ca0 disable inlining deprecated services
@fabpot fabpot closed this as completed Jul 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants