ProxyBuilder does not work properly on PHP 8.3

Created on 17 July 2025, about 1 month ago

Problem/Motivation

The ProxyBuilder doesn't work on newer PHP versions, in particular union types.

Steps to reproduce

When trying to run the following:

php core/scripts/generate-proxy-class.php 'Drupal\book\BookManager' "core/modules/book/src"

or more accurately in my case:

php core/scripts/generate-proxy-class.php 'Drupal\book\BookManager' "modules/contrib/book/src/"

The following exception is thrown:

Error: Call to undefined method ReflectionUnionType::isBuiltin() in /var/www/html/web/core/lib/Drupal/Component/ProxyBuilder/ProxyBuilder.php on line 272

This is due to certain API changes in PHP.

Proposed resolution

Update the code to better support newer PHP 8.0+ type notation.

Remaining tasks

Provide issue fork.

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

🐛 Bug report
Status

Active

Version

11.0 🔥

Component

base system

Created by

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

Comments & Activities

Production build 0.71.5 2024