Annotation component has an undeclared dependency on doctrine/lexer 2

Created on 16 March 2024, 8 months ago
Updated 31 March 2024, 8 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 about 19 hours 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.71.5 2024