Closed (fixed)
Project:
Drupal core
Version:
11.x-dev
Component:
composer
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
7 Sep 2026 at 09:08 UTC
Updated:
2 Oct 2026 at 22:55 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #3
mondrakecomposer update mglaman/phpstan-drupal phpstan/extension-installer phpstan/phpstan phpstan/phpstan-deprecation-rules phpstan/phpstan-phpunitwould update the whole bunch of PHPStan extensions
Comment #4
longwaveI did the other ones over in #3621275: Update Composer dependencies for 12.0.0-beta1 - everything there updates cleanly.
Comment #5
longwaveIn fact maybe only the Drupal extensions are the problem here, maybe we can upgrade PHPStan itself in the other issue.
edit: no, see https://git.drupalcode.org/project/drupal/-/jobs/12034440
Comment #6
longwaveThe improvement is significant.
2.2.8 took about two minutes for a full run: https://git.drupalcode.org/project/drupal/-/jobs/11964790
2.2.13 takes 33 seconds: https://git.drupalcode.org/project/drupal/-/jobs/12034563
Comment #7
longwaveUnsure if we want to fix any of those new baselined errors here, a lot of them seem non trivial.
Comment #8
godotislateMerge conflict bc #3621275: Update Composer dependencies for 12.0.0-beta1 is in. (Gitlab UI strangely not showing even it says there's a conflict if I try to rebase.)
Also, do we need to wait on https://github.com/phpstan/phpstan/issues/15192?
Comment #9
longwaveRebased. The GitLab UI has been a bit laggy recently, it takes some minutes to update after something has been pushed.
I don't think we need to wait for that issue, it emits the warning but it appears it can be safely ignored.
Comment #10
godotislateRan
composer require "mglaman/phpstan-drupal":"^2.1.2" "phpstan/phpstan":"^2.2.13" --devand regenerated baseline and got the same changes.lgtm
Comment #11
mstrelan commentedThat's a few baseline additions. Maybe we should combine this with #3425412: [mid-Oct 2026] Bump PHPStan rule level to 3?
Comment #12
longwaveI think we should backport this to 11.x for the speed improvements alone, we won't bump the level there though.
Comment #13
mstrelan commentedIMHO if most of the baseline changes come from mglaman/phpstan-drupal we should split that out and review it separately so we can get the speed changes in without too much conflict.
Comment #14
longwave@mstrelan we have very little time left until 12.0.0-beta1 and so I think adding to the baseline here is the pragmatic thing to do, breaking this down further just risks missing the deadline, and it's already RTBC.
Comment #15
mstrelan commentedOk that's fine, I was just trying to avoid having two separate issues making large baseline changes to avoid conflicts, but happy to proceed.
Comment #16
longwaveAdditionally I don't think the level 3 issue should land until after beta because it will likely disrupt many if not most open MRs.
Comment #17
catchCommitted/pushed to main, thanks!
Moving to 11.x for backport.
Comment #18
catchNo actually the commit never went through - three new errors introduced, I think we need a baseline update here again.
Comment #20
catchWent ahead and regenerated the baseline locally and committed.
Back to 11.x for backport again.
The is_file() warning is noisy, but it's not affecting the CI job pass and I saw a fix got committed for it already, we can update to the next patch release when it comes out.
Had to do the actual commit with --no-verify because phpcs didn't like having nothing to analyse.
Comment #21
mondrake#20 the bug upstream was fixed
https://github.com/phpstan/phpstan/issues/15192
https://github.com/phpstan/phpstan-src/pull/6397
It should be matter of days before a 2.2.14 will be out and we can bump to it.
Comment #23
longwaveComment #24
catchPHPStan is failing on main with https://git.drupalcode.org/project/drupal/-/jobs/12129494
Comment #25
catchPassed with a re-run, not really sure what that means...
Comment #26
longwaveHm there is something flaky going on here, look at the last commit where I had to baseline something additional like that, and now it's failed again.
Comment #27
longwaveComment #28
longwaveMaybe we can globally ignore
loadIncludes.fileNotLoadablewhile we work this out?Comment #29
catchYes I've just seen it again too - going to revert. Globally ignoring and then opening an issue (against phpstan probably) sounds good.
Comment #31
catchComment #32
catchComment #33
mondrake2.2.14 was released today
Comment #34
catchComment #38
quietone commentedComment #39
quietone commented11.x has a failure in Drupal\Tests\Core\Test\WorkAllocatorTest::testAllocator which I don't know enough about and I am concentrating on other things right now.
Comment #40
catch11.x is fixed now - was an HEAD failure due to a test-only backport. Rebased and the 11.x is green.
So I think it is just the
mainMR to update now.Comment #41
quietone commentedI forgot to comment that I updated the main branch. That was a few hours ago. But I rebased again, because why not?
Comment #42
mondrakeUnless I am missing something, I do not see #28/#29 addressed. Or maybe it's no longer a problem?
Comment #43
catchThe 11.x branch has https://git.drupalcode.org/project/drupal/-/merge_requests/17087/diffs?c... which looks like it should resolve it.
But I don't see that in the main commit.
Comment #44
quietone commentedDarn! Added an ignore with an @todo in phpstan.neon.dist
Comment #45
needs-review-queue-bot commentedThe 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.
Comment #46
quietone commentedNo, the diff applies.
Comment #47
needs-review-queue-bot commentedThe 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.
Comment #48
quietone commentedComment #49
mondrakeIt feels weird that in main we need a global ignore, whereas in 11.x not? Is there a difference in the code analysed?
Comment #50
catchI checked the new baseline entries and it's mostly:
This is something we should clean up so it's a valid new entry.
This all looks good to me now.
Comment #51
catchThe 11.x branch had the ignore at least a couple of days ago, but my link to it is breaks the gitlab UI... https://git.drupalcode.org/project/drupal/-/merge_requests/17087/diffs?c...
Comment #52
catchOh in 11.x they're individually added to the baseline, either that changed or I read it incorrectly:
I think we need to add the global ignore to 11.x too then. Leaving RTBC since we could probably change that as part of the backport.
Comment #53
godotislateIn the 11.x MR mglaman/phpstan-drupal is bumped to 2.2.0, and it's only 2.1.2 on main. I think these two should probably be in sync as well? There's also a 2.2.1 release as of today, so it might be easier to bump both of them to that.
Comment #54
godotislateOK, bumped both MRs so they're in sync at mglaman/phpstan-drupal 2.2.1, and added the global ignore to 11.x.
This introduced some new baseline entries in the main MR. Also needed to manually update PinnedDevDependencies, since the builder was removed from main.
Comment #55
catchI re-reviewed all the changes except the baseline (which I did review a bit before the most recent update from @godotislate), I think this is ready to commit again.
Comment #56
mondrakeI am still confused by the need to add a global ignore instead of adding to the baseline the actual errors - and for main only. To me it means the baseline would not be deterministic, and there would be random occasions where the error is reported and other not, which would be a primer in static analysis. Is that the case, can't we just add to the baseline as in 11.x?
Comment #57
godotislate@mondrake latest update to 11.x has the same global ignore, noted in #54.
Comment #58
catch@mondrake after the initial commit here we started to get seemingly random phpstan failures on various MRs, for example:
in https://git.drupalcode.org/project/drupal/-/jobs/12129494
Not every MR was affected but several were, iirc the errors were showing up in different tests on the MRs that failed too.
phpstan recently introduced a native PHP extension which is swapped in at runtime for child processes, maybe this (or something else new in this release) is struggling with includes - most modern PHP applications don't dynamically include files outside of autoloading, so it would be quite possible that what is for us a backwards compatibility layer is the only, or at least first, code that's hitting the bug.
#3624168: Fix loadIncludes.fileNotLoadable phpstan violations is open to look into this more, and we can try removing the global ignore there, see if we can get an MR run to fail. We could also try an experiment and remove the global ignore in HEAD too via that issue if that will help track down the problem and we can't reproduce on MR runs. But what I really don't want to do is introduce 80% random test failures when we're desperately trying to tag the beta alongside having dozens of RTBC issues in the queue.
Comment #59
mondrakeSure, thanks for explaining!
Comment #60
larowlanNeeds a reroll after #3595089: Remove the Olivero theme
Comment #61
godotislateBoth MRs rerolled and main baseline regenerated.
Comment #64
larowlanCommitted to main and 11.x - thanks!