Bump phpstan/phpstan to latest to make daily "updated deps" QA run pass again

Created on 26 July 2024, 3 months ago
Updated 23 August 2024, about 2 months ago

Problem/Motivation

PHPStan released version 1.11.8(See https://github.com/phpstan/phpstan/releases/tag/1.11.8).

After numerous worry-free updates this one uncovers previously unspotted Level 1 issues.

Steps to reproduce

See https://git.drupalcode.org/project/drupal/-/pipelines/234420 and notice the PHP Static Analysis (phpstan) failures on the DEFAULT: Updated dependencies (PHP 8.3 MySQL 8) job for 11.x.

The failures seems to be coming from two enhancements:

Ignored error pattern #^Foo# in path /bar.baz is expected to occur N time, but occurred N+1 times. => Report "missing return" error closer to where the return is missing.
Call to preg_quote() is missing delimiter / to be effective. => https://github.com/phpstan/phpstan/issues/11338

The first type "just" needs a new baseline with the more accurate suppression, which should end up in only the value of count in some suppressions going up.

Turns out explicitly declaring the default value NULL for the $delimiter parameter of preg_quote() appeases PHPStan and makes no changes in the execution of the code (since it's the default value).
Seems like the most safe approach and this is taken in the MR.

Proposed resolution

- Upgrade phpstan/phpstan to 1.11.8
- Create a new baseline, fix Call to preg_quote() is missing delimiter / to be effective.-failures.
- Bump versions of phpstan/phpstan in composer.* to latest, since the newly created baseline won't pass on any lower version.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

📌 Task
Status

Fixed

Version

11.0 🔥

Component
PHPUnit 

Last updated 1 day ago

Created by

🇳🇱Netherlands spokje

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