-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Description
| Q | A |
|---|---|
| BC Break | no |
| Version | 3.0.0-dev |
As reported by PHPStan in #4094 (2.10.x),
Lines 99 to 102 in 15d9be0
| - | |
| message: '~Method Doctrine\\DBAL\\Portability\\Connection::prepare\(\) should return Doctrine\\DBAL\\Statement but returns Doctrine\\DBAL\\Portability\\Statement\.~' | |
| paths: | |
| - %currentWorkingDirectory%/lib/Doctrine/DBAL/Portability/Connection.php |
In 3.0.x where the driver and wrapper APIs started diverging (#4045), it results in the following:
$conn = DriverManager::getConnection([
'driver' => 'pdo_sqlite',
]);
foreach ($conn->prepare('SELECT 1')->execute()->iterateColumn() as $value) {
var_dump($value);
}
// string(1) "1"
$conn = DriverManager::getConnection([
'driver' => 'pdo_sqlite',
'wrapperClass' => \Doctrine\DBAL\Portability\Connection::class,
'portability' => \Doctrine\DBAL\Portability\Connection::PORTABILITY_ALL,
'fetch_case' => \Doctrine\DBAL\ColumnCase::LOWER,
]);
foreach ($conn->prepare('SELECT 1')->execute()->iterateColumn() as $value) {
var_dump($value);
}
// Fatal error: Call to undefined method Doctrine\DBAL\Portability\Result::iterateColumn()