From 481c781d4f46b15dfd1a995152cd69f5f1c93ccc Mon Sep 17 00:00:00 2001 From: mgiraud Date: Mon, 16 Mar 2026 06:56:22 +0100 Subject: [PATCH 1/2] Deprecate annotation classes --- composer.json | 1 + src/Annotation/Desc.php | 1 + src/Annotation/Ignore.php | 1 + src/Annotation/Translate.php | 1 + 4 files changed, 4 insertions(+) diff --git a/composer.json b/composer.json index 10c604c..fa423e7 100644 --- a/composer.json +++ b/composer.json @@ -11,6 +11,7 @@ "require": { "php": "^8.1", "nikic/php-parser": "^5.0", + "symfony/deprecation-contracts": "^2.5 || ^3.0", "symfony/finder": "^5.4 || ^6.4 || ^7.0", "twig/twig": "^2.0 || ^3.0", "phpstan/phpdoc-parser": "^2.3" diff --git a/src/Annotation/Desc.php b/src/Annotation/Desc.php index 32771ec..24a6817 100644 --- a/src/Annotation/Desc.php +++ b/src/Annotation/Desc.php @@ -11,6 +11,7 @@ namespace Translation\Extractor\Annotation; +trigger_deprecation('php-translation/extractor', '2.3', 'The "%s" class is deprecated with no replacement, it is now considered as a PHPDoc tag.', Desc::class); /** * @deprecated since 2.3, this class is not used anymore. @Desc is now considered as a PHPDoc tag. * diff --git a/src/Annotation/Ignore.php b/src/Annotation/Ignore.php index bd33625..b7da981 100644 --- a/src/Annotation/Ignore.php +++ b/src/Annotation/Ignore.php @@ -11,6 +11,7 @@ namespace Translation\Extractor\Annotation; +trigger_deprecation('php-translation/extractor', '2.3', 'The "%s" class is deprecated with no replacement, it is now considered as a PHPDoc tag.', Ignore::class); /** * @deprecated since 2.3, this class is not used anymore. @Ignore is now considered as a PHPDoc tag. * diff --git a/src/Annotation/Translate.php b/src/Annotation/Translate.php index 20e2852..7d8aea0 100644 --- a/src/Annotation/Translate.php +++ b/src/Annotation/Translate.php @@ -11,6 +11,7 @@ namespace Translation\Extractor\Annotation; +trigger_deprecation('php-translation/extractor', '2.3', 'The "%s" class is deprecated with no replacement, it is now considered as a PHPDoc tag.', Translate::class); /** * @deprecated since 2.3, this class is not used anymore. @Translate is now considered as a PHPDoc tag. * From f856c2b6251cd91e7436df8f3160e272a2608dec Mon Sep 17 00:00:00 2001 From: mgiraud Date: Mon, 16 Mar 2026 12:26:16 +0100 Subject: [PATCH 2/2] More explicit deprecation message --- src/Annotation/Desc.php | 2 +- src/Annotation/Ignore.php | 2 +- src/Annotation/Translate.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Annotation/Desc.php b/src/Annotation/Desc.php index 24a6817..8097058 100644 --- a/src/Annotation/Desc.php +++ b/src/Annotation/Desc.php @@ -11,7 +11,7 @@ namespace Translation\Extractor\Annotation; -trigger_deprecation('php-translation/extractor', '2.3', 'The "%s" class is deprecated with no replacement, it is now considered as a PHPDoc tag.', Desc::class); +trigger_deprecation('php-translation/extractor', '2.3', 'The "%s" class is deprecated and will be removed soon. It is now considered as a PHPDoc tag.', Desc::class); /** * @deprecated since 2.3, this class is not used anymore. @Desc is now considered as a PHPDoc tag. * diff --git a/src/Annotation/Ignore.php b/src/Annotation/Ignore.php index b7da981..bbb9333 100644 --- a/src/Annotation/Ignore.php +++ b/src/Annotation/Ignore.php @@ -11,7 +11,7 @@ namespace Translation\Extractor\Annotation; -trigger_deprecation('php-translation/extractor', '2.3', 'The "%s" class is deprecated with no replacement, it is now considered as a PHPDoc tag.', Ignore::class); +trigger_deprecation('php-translation/extractor', '2.3', 'The "%s" class is deprecated and will be removed soon. It is now considered as a PHPDoc tag.', Ignore::class); /** * @deprecated since 2.3, this class is not used anymore. @Ignore is now considered as a PHPDoc tag. * diff --git a/src/Annotation/Translate.php b/src/Annotation/Translate.php index 7d8aea0..722e740 100644 --- a/src/Annotation/Translate.php +++ b/src/Annotation/Translate.php @@ -11,7 +11,7 @@ namespace Translation\Extractor\Annotation; -trigger_deprecation('php-translation/extractor', '2.3', 'The "%s" class is deprecated with no replacement, it is now considered as a PHPDoc tag.', Translate::class); +trigger_deprecation('php-translation/extractor', '2.3', 'The "%s" class is deprecated and will be removed soon. It is now considered as a PHPDoc tag.', Translate::class); /** * @deprecated since 2.3, this class is not used anymore. @Translate is now considered as a PHPDoc tag. *