Annotation component has an undeclared dependency on doctrine/lexer 2

Created on 16 March 2024, 3 months ago
Updated 31 March 2024, 3 months ago

Problem/Motivation

We previously forked part of Doctrine's doctrine/annotations package into core at \Drupal\Component\Annotation\Doctrine.

The DocParser class depends on doctrine/lexer but this is only implicitly declared via a dependency on doctrine/annotations. However, the code is only compatible with version 2 of doctrine/lexer and upgrading to v3 results in a fatal error.

Steps to reproduce

$ composer update doctrine/lexer
$ drush cr
PHP Fatal error:  Uncaught Error: Cannot use object of type Doctrine\Common\Lexer\Token as array in /var/www/html/drupal/core/lib/Drupal/Component/Annotation/Doctrine/DocParser.php:619

Proposed resolution

Add an explicit dependency on doctrine/lexer:^2.0 to both the Annotation component and core itself.
In a followup, upgrade this to doctrine/lexer:^3.0 for Drupal 11.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

πŸ› Bug report
Status

Fixed

Version

11.0 πŸ”₯

Component
ComposerΒ  β†’

Last updated 2 days ago

No maintainer
Created by

πŸ‡¬πŸ‡§United Kingdom longwave UK

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.69.0 2024