Prepare for PHPStan 2.x

Created on 21 January 2025, about 2 months ago

Overview

Drupal 11.x now ships with PHPStan 2.0 and 11.2.0 will be the first stable version to use it.

We can test locally by running XB against Drupal 11.x. Currently this reports three configuration errors:

Invalid entries in excludePaths:
Path /var/www/html/web/modules/contrib/experience_builder/modules/same_page_preview is neither a directory, nor a file path, nor a fnmatch pattern.

Path /var/www/html/web/modules/contrib/experience_builder/tests/src/Cypress/node_modules is neither a directory, nor a file path, nor a fnmatch pattern.

Path /var/www/html/web/modules/contrib/experience_builder/src/Extension/XbIncludeEmbedVisitor.php is neither a directory, nor a file path, nor a fnmatch pattern.

If the excluded path can sometimes exist, append (?)
to its config entry to mark it as optional.

After fixing these, PHPStan reports 56 (!) new errors in our code that we should fix.

Proposed resolution

User interface changes

πŸ“Œ Task
Status

Active

Version

0.0

Component

Code

Created by

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

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

Comments & Activities

Production build 0.71.5 2024