From e250fc36cddbc045ab43b57a0a24473de263b732 Mon Sep 17 00:00:00 2001 From: Andrew Berry Date: Tue, 11 Aug 2026 12:52:37 -0400 Subject: [PATCH] feat(deps): drop doctrine/annotations All serializer metadata in src/ is declared with PHP 8 attributes (#[Serializer\...]); there are no docblock @Serializer annotations left. JMS Serializer's DefaultDriverFactory only requires doctrine/annotations below PHP 8.0 -- above that it registers AnnotationOrAttributeDriver with a null reader, and that driver reads attributes via reflection unconditionally. Since this package requires PHP ^8.2, the annotation reader was never doing any work. Nothing else in the dependency graph requires doctrine/annotations at runtime (jms/serializer and jms-serializer-uri-handler both list it under require-dev), so this removes it, and its psr/cache dependency, from consumers' installs rather than leaving it behind transitively. Released as a minor rather than a patch because of one downstream edge case: getSerializerBuilder() is public API, and anyone who takes that builder and serializes their own docblock-annotated classes will silently lose that metadata rather than get an error. Such consumers should add doctrine/annotations to their own composer.json. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_013DMMmSMemViyZXtmDwQgvk --- composer.json | 1 - composer.lock | 128 +------------------------------------------------- 2 files changed, 1 insertion(+), 128 deletions(-) diff --git a/composer.json b/composer.json index 879508b..9f60bca 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,6 @@ "php": "^8.2", "ext-json": "*", "jms/serializer": "^3.0", - "doctrine/annotations": "^2.0", "guzzlehttp/psr7": "^3.0", "psr/http-client": "^1.0", "deviantintegral/jms-serializer-uri-handler": "^1.1", diff --git a/composer.lock b/composer.lock index 1582b3e..0d096bd 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "81425c41e24a952b3431d5be94b5dd3c", + "content-hash": "6937b1e5aef930a96a5ba9ef1fac22cf", "packages": [ { "name": "deviantintegral/jms-serializer-uri-handler", @@ -98,83 +98,6 @@ }, "time": "2026-04-15T23:48:29+00:00" }, - { - "name": "doctrine/annotations", - "version": "2.0.2", - "source": { - "type": "git", - "url": "https://github.com/doctrine/annotations.git", - "reference": "901c2ee5d26eb64ff43c47976e114bf00843acf7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/901c2ee5d26eb64ff43c47976e114bf00843acf7", - "reference": "901c2ee5d26eb64ff43c47976e114bf00843acf7", - "shasum": "" - }, - "require": { - "doctrine/lexer": "^2 || ^3", - "ext-tokenizer": "*", - "php": "^7.2 || ^8.0", - "psr/cache": "^1 || ^2 || ^3" - }, - "require-dev": { - "doctrine/cache": "^2.0", - "doctrine/coding-standard": "^10", - "phpstan/phpstan": "^1.10.28", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "symfony/cache": "^5.4 || ^6.4 || ^7", - "vimeo/psalm": "^4.30 || ^5.14" - }, - "suggest": { - "php": "PHP 8.0 or higher comes with attributes, a native replacement for annotations" - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "Docblock Annotations Parser", - "homepage": "https://www.doctrine-project.org/projects/annotations.html", - "keywords": [ - "annotations", - "docblock", - "parser" - ], - "support": { - "issues": "https://github.com/doctrine/annotations/issues", - "source": "https://github.com/doctrine/annotations/tree/2.0.2" - }, - "abandoned": true, - "time": "2024-09-05T10:17:24+00:00" - }, { "name": "doctrine/instantiator", "version": "2.0.0", @@ -653,55 +576,6 @@ }, "time": "2026-07-08T07:01:06+00:00" }, - { - "name": "psr/cache", - "version": "3.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/cache.git", - "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/cache/zipball/aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", - "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", - "shasum": "" - }, - "require": { - "php": ">=8.0.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Cache\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common interface for caching libraries", - "keywords": [ - "cache", - "psr", - "psr-6" - ], - "support": { - "source": "https://github.com/php-fig/cache/tree/3.0.0" - }, - "time": "2021-02-03T23:26:27+00:00" - }, { "name": "psr/container", "version": "2.0.2",