Description
Feature request
Repro: https://phpstan.org/r/a737df77-1a70-4ef6-af8d-c3a605bf84cc
PHP 8.4 added PDO::connect static function which returns a PDO subclass for a specific driver
https://www.php.net/manual/en/pdo.connect.php
However the issue here, even if you added support for parsing the DSN string to get the correct subclass, I suspect most of them will be coming from configs/env, so it may not be available at analysis time.
Unsure what a good solution for this would be, for now I can manually narrow the type with a comment:
/** @var \Pdo\Mysql $db */
$db = PDO::connect();
return $db;
Did PHPStan help you today? Did it make you happy in any way?
No response