You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
\Symfony\Component\Cache\Adapter\PdoAdapter::__construct() 1st param is $connOrDsn.
The DocBlock Comment currently section says: @param \PDO|string $connOrDsn, however it can also be of type \Doctrine\DBAL\Connection.
Because of the DocBlock Comment is currently missing the Connection type, some static analyzers (phpstan) fails when we provide a Connection object.
How to reproduce
use Doctrine\DBAL\DriverManager;
use Symfony\Component\Cache\Adapter\PdoAdapter;
$connUrl = 'mysql://user:passsword@127.0.0.1/db_name';
$conn = DriverManager::getConnection( [ 'url' => $connUrl ]);
new PdoAdapter( $conn, 'mycache', 3600 );
Then run phpstan on it
Possible Solution
in vendor/symfony/cache/Adapter/PdoAdapter.phpLink to GitHub line change line 59 to this: