Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Ability to deprecate aliases #24507

Copy link
Copy link
Closed
Closed
Copy link
@greg0ire

Description

@greg0ire
Issue body actions
Q A
Bug report? no
Feature request? yes
BC Break report? no
RFC? no
Symfony version 3.3.10

I'm getting deprecations from bundles such as described here, and it seems the solution to those deprecations would be to rename services so that the id matches the FQCN, and then alias those services to the previous service id for BC.
I thought deprecating the aliases would be a good idea too, but when I try, it looks like this is not supported, and I get the following error:

Using the element "deprecated" is deprecated for the service "nelmio_alice.faker.generator" which is defined as an alias in "/var/www/html/vendor/nelmio/alice/src/Bridge/Symfony/DependencyInjection/../Resources/config/faker.xml". The XmlFileLoader will raise an exception in Symfony 4.0, instead of silently ignoring unsupported elements.

Here is what I tried:

        <service id="nelmio_alice.faker.generator" alias="Faker\Generator">
            <deprecated>The "nelmio_alice.faker.generator" is deprecated in favor of the Faker\Generator FQCN.</deprecated>
        </service>
        <service id="Faker\Generator"
                 class="Faker\Generator">
            <factory class="Faker\Factory" method="create" />

            <argument>%nelmio_alice.locale%</argument>

            <call method="seed">
                <argument>%nelmio_alice.seed%</argument>
            </call>

            <!-- Calls to add tagged providers are made in a compiler pass -->
        </service>

I understand the deprecated element I tried to use in my alias is not supported. Should Symfony provide the ability to deprecate aliases, or is there a better way to avoid the deprecations I'm talking about?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.