[DEPRECATION] Add `package` and `version` to deprecated service declarations
althaus opened this issue · comments
Hi,
symfony/dependency-injection 5.1 added a deprecation for not setting package
and version
in the service.yaml when using deprecated
:
Since symfony/dependency-injection 5.1: Not setting the attribute "package" of the "deprecated" option in ".\php-translation\symfony-bundle\DependencyInjection/../Resources/config\services.yaml" is deprecated.
Before:
# To remove in next major release
php_translation.catalogue_fetcher:
parent: Translation\Bundle\Catalogue\CatalogueFetcher
deprecated: 'The "%service_id%" service is deprecated. You should stop using it, as it will be removed in the future.'
public: true
After:
# To remove in next major release
php_translation.catalogue_fetcher:
parent: Translation\Bundle\Catalogue\CatalogueFetcher
deprecated:
package: 'php-translation/symfony-bundle'
version: '0.11.3'
message: 'The "%service_id%" service is deprecated. You should stop using it, as it will be removed in next major release.'
# message: ~ # As an alternative. This'd fallback to the prior default message.
public: true
Using this service will then track this message in the log:
User Deprecated: Since php-translation/symfony-bundle 0.11.3: The "php_translation.catalogue_fetcher" service is deprecated. You should stop using it, as it will be removed in the future.
Cheers
Matthias
Thank you for such a detailed explanation with great examples! Would you like to create a PR for this?
Would you like to create a PR for this?
Yes!
I've just opened #421 to fix this issue. :)
Any update here guys, I would really like to clear out the deprecation notices. 👍
Thanks in advance for the effort!
@kadiiskiFFW we have a PR for this, see #421 . Have you tried that? Does it solve all deprecations for you? Feel free to review.
@althaus thank you for working on this! I made an alternative to #421 PR to suppress the deprecations via PHP configuration, see #445 - please, give it a review //cc @kadiiskiFFW
Thanks for jumping in. Been working an other projects for a while, but I'll try to check it out.