Closed (fixed)
Project:
Drupal core
Version:
main
Component:
base system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
31 Jan 2026 at 03:01 UTC
Updated:
23 Feb 2026 at 10:04 UTC
Jump to comment: Most recent
----------------------------------------------------------------------------------------------------
Running PHPStan on *all* files.
------ --------------------------------------------------------------------
Line core/modules/mysql/src/Driver/Database/mysql/Connection.php
------ --------------------------------------------------------------------
125 Array has 3 duplicate keys with value 0
(\Pdo\Mysql::ATTR_USE_BUFFERED_QUERY, \Pdo\Mysql::ATTR_FOUND_ROWS,
\Pdo\Mysql::ATTR_MULTI_STATEMENTS).
🪪 array.duplicateKey
------ --------------------------------------------------------------------Resolve it
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
Comment #2
larowlanComment #3
mondrakeThe bot is systematically killing the RTBC queue right now.
Comment #4
andypostIt needs update phpstan at least to 2.1.35 to use proper stubs https://github.com/JetBrains/phpstorm-stubs/commit/d955c006e300377c12aba...
Comment #6
andypostupdated to latest 2.1.38
Comment #7
mondrakeIt does not seem that HEAD pipelines are broken, though. Rather, it’s the check done by the bot that is failing. No?
Comment #8
andypostbasically stub shipped with phpstan are bundled into it so 1.x branch makes no sense anymore
Comment #9
andypostLooking at date of release - 2.1.36 is tagged in few hours after fix of stubs
Comment #11
mondrakeBumping PHPStan is good in itself, but I still do not understand why MR pipelines targeting main are passing, while the bot is failing.
Comment #12
alexpottCan someone post what is actually failing? HEAD is not failing - the daily tests are not.
Comment #13
mondrake#12 exactly. HEAD is fine. It’s the bot running a script that fails and therefore changing issue status to NW. It happened to half the RTBC issues already.
Example of failure: https://www.drupal.org/project/drupal/issues/3558167#comment-16448917
Comment #14
longwaveThe bot is a script that runs on @nod_'s computer - not sure how it works exactly, maybe it doesn't use the same versions?
I think we need a kill switch for it somewhere so we can turn it off in situations like this.
Comment #15
nod_I stopped the bot for now. I think I'll change the approach and stop testing locally. I might see if I can trigger the verification steps periodically in the CI directly instead of doing that locally.
The bot does a composer/yarn install then runs
./core/scripts/dev/commit-code-check.shon php 8.4.6.Comment #16
mondrake#15: +1.
We should have one source of truth only, and IMHO that should be the CI results.
Two sources of truth = beginning of holy war 😁
Comment #17
alexpott@nod_ can the bot use .gitlab-ci/php.yml to determine which PHP to use?
Comment #18
mondrakeComment #19
andypostfixed in main, still unsure about drop 1.x support from 11.x branch
Comment #21
mondrakeI've hidden the 11.x branch for now. In main for sure it's high time we drop that.
Comment #22
nicxvan commentedI'll just chime in to say the bot does occasionally find things that ci doesn't when an mr is behind.
For example when tests began to require the run in separate process attribute it was easy to forget on a branch that hasn't been rebased but the bot would catch it. The error in those cases cutoff have been improved. And a way to pause the bot externally would be good to prevent situations like last night.
Comment #23
alexpottYeah a bot testing RTBCs for code style and stuff is great - it just needs to be configured using details from the branch it is testing.
Committed cc433fe and pushed to main. Thanks!
Comment #26
mondrakeToo late... will open a follow up.
Comment #27
nicxvan commentedThe target branch right?
Comment #28
mondrakeRe #26
Comment #29
alexpott@nicxvan nope but an MR change change the minimum PHP for example... which is why the bot broke everything.
Comment #30
cmlaraIt appears this may be reverting #3532698: phpstan dev constraints make it difficult for modules to support 11.2 and below
This change will likely force all contrib to upgrade to PHPStan 2.x .
It appears 10.6 (which is supported until December 2026) still only supports PHPStan 1, Contrib will need to support ^1||^2 for at least another year.
Comment #31
longwave@cmlara this was only committed to main which will become Drupal 12, the 11.x and 10.6.x branches are still open separately? At some point we have to stop supporting PHPStan 1, Drupal 12 seems like a good time to do that.
Comment #32
cmlaraIIRC most talk has been about encouraging modules to support D10.6 through D12 in a single release (which is very doable from a Drupal API standpoint for most modules).
The PHPStan config files are often different between the two PHPStan majors, changes, some config options needed in one version of PHPstan would raise fatal errors in the opposite major (I have since learned of a few tricks that could maybe help avoid this, however they seem hacky and possibly are off-api usage of PHPStan).
#3530909: Create metapackage of (loose) contrib test dependencies would be the Ideal solution, with D13 being a fallback (or if you wanted to get hacky, something like a 12.3 release)
Comment #33
alexpottI think if you want to run phpstan against mulitple versions of core you are going to need use different baselines. Personally, on my contrib projects (some of which support D9 to D11) I only run PHPStan on the latest Drupal version. Most of them have decent test coverage so I don't feel that PHPStan on older versions adds much and it avoids things like having to maintain multiple baselines because of deprecations.
Comment #34
cmlaraDiffrent baseline is the least hacky aspect, if using a PHP baseline one can do a simple
ifstatement to include or exclude entries based on version (if even needed, I have a pretty good idea of what errors are per versions, and when not I just run it on the root release and the fix release and look for an error count difference).Root phpstan.neon changes however can be test breaking between ^1 and ^2 (preventing even running any analysis).
Not wrong, especially with how under documented core is especially in older releases, however core shouldn’t be forcing developers into a position where they can’t make a decision for their own.
As written my modules require phpstan
^1in require dev, if I move it to^2all composer stages will fail for 10.6 preventing running PHPUnit tests. I could lie and claim^1 || ^2however that sets a poor experience for those running the module (not much better that core does it, however it is easier to explain a single package instead of hundreds of contrib packages).The above is also ignoring that phpstan-drupal (last I looked) still had faults misidentifying code paths (entityquery access control comes to mind) and I’m giving it more time to stabilize before adopting its 2.x branch.