Problem/Motivation

PHPStan 2.3.1 was released on Oct 8, 2026. Bump to it.

Proposed resolution

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

CommentFileSizeAuthor
#8 3629920-nr-bot_helph_fs.txt631 bytesneeds-review-queue-bot

Issue fork drupal-3629920

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mondrake created an issue. See original summary.

mondrake’s picture

Issue summary: View changes
Parent issue: #3486713: Bump PHPStan to version 2.0.4 »
mondrake’s picture

Version: 11.x-dev » main
mondrake’s picture

Issue tags: -11.2.0 release notes

composer update phpstan/phpstan mglaman/phpstan-drupal phpstan/phpstan-deprecation-rules phpstan/phpstan-phpunit spaze/phpstan-disallowed-calls

mondrake’s picture

Status: Active » Needs review
mondrake’s picture

Is composer/Metapackage/PinnedDevDependencies/composer.json no longer updated on a composer update --lock? I had to manually update it for phpstan/phpstan, which would make EnsurePHPStanVersionsMatchTest rather foolish.

needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new631 bytes

The Needs Review Queue Bot tested this issue. It fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

mondrake’s picture

Status: Needs work » Needs review
Issue tags: +no-needs-review-bot

Bot?

mondrake’s picture

mondrake’s picture

I tried to remove the global ignore for #3624168: [upstream, likely] Fix loadIncludes.fileNotLoadable phpstan violations and replace it with individual @phpstan-ignores in-place, but the behavior seems really random (which for static analysis sounds like a paradox). So reverted last two commits.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Seems like an innocent enough update that didn't break anything in core.

  • catch committed f261bf90 on 12.0.x
    task: #3629920 Bump PHPStan to version 2.3.1
    
    By: mondrake
    
catch’s picture

Version: main » 11.x-dev
Status: Reviewed & tested by the community » Patch (to be ported)

Committed/pushed to main. Also to 12.0.x - I tried to cherry-pick, but this needed the baseline to be rebuilt locally, and then git cherry-pick --continue failed due to phpcs not finding any files, and doesn't have a --no-verify option, so went for a separate commit instead. I think there's already an issue open for phpcs failing on an empty file list.

We should probably backport this to 11.x too but better to have a fresh MR for that I think.

  • catch committed e8a17296 on main
    task: #3629920 Bump PHPStan to version 2.3.1
    
    By: mondrake
    

  • xjm committed 3971a3ff on 12.0.x
    Revert "task: #3629920 Bump PHPStan to version 2.3.1"
    
    This reverts...

  • xjm committed e300703d on main
    Revert "task: #3629920 Bump PHPStan to version 2.3.1"
    
    This reverts...
xjm’s picture

Status: Patch (to be ported) » Needs work

Sorry, had to roll this back because it introduced packaging fails on both branches. From @drumm:

> /usr/bin/php8.4 /usr/local/bin/composer --working-dir=/var/lib/subtree-splits/drupal/12.0.x/5fcebc1168ecb0d6c28d89b7cd02e524b3997d18/subtree-workdirs/legacy-project -n require --dev --no-security-blocking drupal/core-dev:12.0.x-dev drupal/core-dev-pinned:12.0.x-dev
./composer.json has been updated
Running composer update drupal/core-dev drupal/core-dev-pinned
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
  Problem 1
    - Root composer.json requires drupal/core-dev 12.0.x-dev -> satisfiable by drupal/core-dev[12.0.x-dev].
    - Root composer.json requires drupal/core-dev-pinned 12.0.x-dev -> satisfiable by drupal/core-dev-pinned[12.0.x-dev].
    - drupal/core-dev 12.0.x-dev requires phpstan/phpstan-phpunit ^2.1.1 -> satisfiable by phpstan/phpstan-phpunit[2.1.1, 2.1.x-dev].
    - drupal/core-dev-pinned 12.0.x-dev requires phpstan/phpstan-phpunit 2.0.18 -> satisfiable by phpstan/phpstan-phpunit[2.0.18].
    - You can only install one version of a package, so only one of these can be installed: phpstan/phpstan-phpunit[2.0.18, 2.1.1, 2.1.x-dev].
Installation failed, reverting ./composer.json and ./composer.lock to their original content.
mondrake’s picture

See #7 - I think there’s a problem with the pinned dev dependencies composer.json generation. Or at least I had one.

Wouldd be good if anyone can rebuild the MR here from scratch and see if it works.

catch’s picture

Version: 11.x-dev » main
xjm’s picture

Re: #7 it's entirely possible. 12.0.x's initial packaging was also completely borked internally due to mismatch between the branch alias and release tagging utilities, and then after we made the branch-alias-related fix, it was broken a second way when it got to the metapackages. And 11.5.x had broken metapackages and was in a permanently broken state.

Edit: Alternatively there might have been some change in HEAD prior to 12.0.x specifically related to the metapackage... but either way, @godotislate reported the same thing IIRC.

Neil fixed 11.5.x by creating a custom packaging job to force regeneration of the packages. I wonder if that is also applicable to the initial packaging of 12.0.x, and therefore something that will bite us possibly not only in this issue but also for other dev dep updates.

xjm’s picture

I looped in infra in case they can fix 12.0.x the same way, but the issue described in #7 sounds more like an internal core problem. It would be good to check whether something changed it in main only.

mondrake’s picture

Looks like the problem is drupal/core-dev-pinned metapackage is no longer generated. https://drupal.slack.com/archives/C079NQPQUEN/p1792175053825419

mondrake changed the visibility of the branch 3629920-bump-phpstan-to to active.

mondrake’s picture

#18: drupal/core-dev-pinned is deprecated and the metapackage no longer updated. #3631365: Remove stale PinnedDevDependencies composer.json and fix dependent PHPStan test

xjm’s picture

I am pretty sure that d.o packaging depends on that metapackage....