-
-
Notifications
You must be signed in to change notification settings - Fork 946
Closed
Labels
Description
Bug report
With the test script from the playground I get different results depending on whether pdo_mysql is installed or not:
$ php -m|grep pdo_mysql
pdo_mysql
$ vendor/bin/phpstan analyze --no-progress phpstan-test.php
[OK] No errors
If I then disable the extension:
$ php -m|grep pdo_mysql
$ vendor/bin/phpstan analyze --no-progress phpstan-test.php
------ ------------------------------------------------------------------------------------------------------------------------------------------------
Line phpstan-test.php
------ ------------------------------------------------------------------------------------------------------------------------------------------------
9 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
If I try to use @phpstan-ignore I get a similar problem but the other way round.
This is problematic for the Drupal project where different users in different environments may run PHPStan with and without the extension being available.
Code snippet that reproduces the problem
https://phpstan.org/r/6758eb33-677d-4125-88ac-61df8f96f1ce
Expected output
$ php -m|grep pdo_mysql
$ vendor/bin/phpstan analyze --no-progress phpstan-test.php
[OK] No errors
Did PHPStan help you today? Did it make you happy in any way?
PHPStan has fixed many bugs and given developers more confidence in the Drupal codebase - thank you!
Reactions are currently unavailable