8000 Merge branch '3.4' into 4.4 · symfony/symfony@2ebb63a · GitHub
[go: up one dir, main page]

Skip to content

Commit 2ebb63a

Browse files
Merge branch '3.4' into 4.4
* 3.4: Correctly use doctrine/dbal v3+
2 parents 4a51827 + 909931d commit 2ebb63a

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

src/Symfony/Bridge/Doctrine/Security/RememberMe/DoctrineTokenProvider.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Symfony\Bridge\Doctrine\Security\RememberMe;
1313

1414
use Doctrine\DBAL\Connection;
15+
use Doctrine\DBAL\Driver\Result;
1516
use Doctrine\DBAL\Types\Type;
1617
use Doctrine\DBAL\Types\Types;
1718
use Symfony\Component\Security\Core\Authentication\RememberMe\PersistentToken;
@@ -63,7 +64,7 @@ public function loadTokenBySeries($series)
6364
$paramValues = ['series' => $series];
6465
$paramTypes = ['series' => \PDO::PARAM_STR];
6566
$stmt = $this->conn->executeQuery($sql, $paramValues, $paramTypes);
66-
$row = method_exists($stmt, 'fetchAssociative') ? $stmt->fetchAssociative() : $stmt->fetch(\PDO::FETCH_ASSOC);
67+
$row = $stmt instanceof Result ? $stmt->fetchAssociative() : $stmt->fetch(\PDO::FETCH_ASSOC);
6768

6869
if ($row) {
6970
return new PersistentToken($row['class'], $row['username'], $series, $row['value'], new \DateTime($row['last_used']));

src/Symfony/Component/Cache/Tests/Traits/PdoPruneableTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
namespace Symfony\Component\Cache\Tests\Traits;
1313

14-
use Doctrine\DBAL\Result;
14+
use Doctrine\DBAL\Driver\Result;
1515

1616
trait PdoPruneableTrait
1717
{

src/Symfony/Component/Cache/Traits/PdoTrait.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@
1111

1212
namespace Symfony\Component\Cache\Traits;
1313

14+
use Doctrine\DBAL\Abstraction\Result;
1415
use Doctrine\DBAL\Connection;
1516
use Doctrine\DBAL\DBALException;
17+
use Doctrine\DBAL\Driver\Result as DriverResult;
1618
use Doctrine\DBAL\Driver\ServerInfoAwareConnection;
1719
use Doctrine\DBAL\DriverManager;
1820
use Doctrine\DBAL\Exception\TableNotFoundException;
19-
use Doctrine\DBAL\Result;
2021
use Doctrine\DBAL\Schema\Schema;
2122
use Symfony\Component\Cache\Exception\InvalidArgumentException;
2223
use Symfony\Component\Cache\Marshaller\DefaultMarshaller;
@@ -234,7 +235,7 @@ protected function doHave($id)
234235
$stmt->bindValue(':time', time(), \PDO::PARAM_INT);
235236
$result = $stmt->execute();
236237

237-
return (bool) ($result instanceof Result ? $result->fetchOne() : $stmt->fetchColumn());
238+
return (bool) ($result instanceof DriverResult ? $result->fetchOne() : $stmt->fetchColumn());
238239
}
239240

240241
/**
@@ -376,7 +377,7 @@ protected function doSave(array $values, int $lifetime)
376377
}
377378
$result = $stmt->execute();
378379
}
379-
if (null === $driver && !($result instanceof Result ? $result : $stmt)->rowCount()) {
380+
if (null === $driver && !($result instanceof DriverResult ? $result : $stmt)->rowCount()) {
380381
try {
381382
$insertStmt->execute();
382383
} catch (DBALException $e) {

0 commit comments

Comments
 (0)
0