Description
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?