Skip to content

[DEPRECATION] Add package and version to deprecated service declarations #419

@althaus

Description

@althaus

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions