Add a task for phpstan previous major

Created on 22 July 2025, 5 days ago

Problem/Motivation

This is a follow-up on this slack thread.

Currently, PhpStan only runs on current and next major. I remember that we discussed and decided this that way in the early days of the templates project, but there is a scenario which may become more common just now that makes me wonder if we should review that decision. It's about adding BC layers to contrib modules, e.g. for OO Hooks.

Let's say a maintainer adds OO Hooks in Drupal 11.2 to their contrib. They also add the LegacyHooks so that the module still runs on Drupal 10.5. During development and maintenance, developers may run tests locally before they push changes to d.o but I'd be surprised, if developers went as far as testing locally with every Drupal core version they support. Such tests are expected to run in the pipelines, to make sure that nothing got broken.

And tests are running in the pipelines, usually for current, next minor and previous major. But that doesn't include PhpStan when it comes top previous major. And that means, that errors may easily slip through and actually break sites.

Proposed resolution

A PhpStan task for previous major should be added to the templates. What remains to be discussed and decided, whether that task should be on by default in case that testing the previous major is enabled in the first place. That would probably be the most logical approach, but it comes with the side effect that it may change the behaviour of existing pipelines. On the other hand, such a change would just be positive, as it may uncover something bad which was unnoticed so far.

Feature request
Status

Active

Component

gitlab-ci

Created by

🇩🇪Germany jurgenhaas Gottmadingen

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

Comments & Activities

Production build 0.71.5 2024