Problem/Motivation
$ php -m|grep pdo_mysql
$ vendor/bin/phpstan analyze --no-progress -c core/phpstan.neon.dist core/modules/mysql/src/Driver/Database/mysql/Connection.php
------ ------------------------------------------------------------------------------------------------------------------------------------------------
Line 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
------ ------------------------------------------------------------------------------------------------------------------------------------------------
[ERROR] Found 1 error
There is no error if pdo_mysql is available.
Steps to reproduce
Proposed resolution
Add the array entries separately, so PHPStan doesn't consider the duplicates:
$connection_options['pdo'][\PDO::ATTR_ERRMODE] = \PDO::ERRMODE_EXCEPTION;
$connection_options['pdo'][Mysql::ATTR_USE_BUFFERED_QUERY] = TRUE;
$connection_options['pdo'][Mysql::ATTR_FOUND_ROWS] = TRUE;
$connection_options['pdo'][\PDO::ATTR_EMULATE_PREPARES] = TRUE;
$connection_options['pdo'][Mysql::ATTR_MULTI_STATEMENTS] = FALSE;
$connection_options['pdo'][\PDO::ATTR_STRINGIFY_FETCHES] = TRUE;
Remaining tasks
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet
Comments
Comment #3
longwaveBumping to major as this is affecting core committers.
The suggested solution isn't quite correct because settings.php can override these if they really want, so we have to allow the same.
Let's also remove the ableist language while we're here.
Comment #4
longwaveAlso opened https://github.com/phpstan/phpstan/issues/14041 to solve it from the PHPStan side as really I think this is a bug there.
Comment #5
godotislateChanges are very straightforward. Upstream test failure resolved by rebase. lgtm
Comment #8
larowlanCommitted to main - thanks!