10000 Correctly use doctrine/dbal v3+ · symfony/symfony@909931d · GitHub
[go: up one dir, main page]

Skip to content

Commit 909931d

Browse files
Correctly use doctrine/dbal v3+
1 parent ef6fc09 commit 909931d

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,10 +11,11 @@
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;
17-
use Doctrine\DBAL\Result;
1819
use Doctrine\DBAL\Schema\Schema;
1920
use Symfony\Component\Cache\Exception\InvalidArgumentException;
2021

@@ -217,7 +218,7 @@ protected function doHave($id)
217218
$stmt->bindValue(':time', time(), \PDO::PARAM_INT);
218219
$result = $stmt->execute();
219220

220-
return (bool) ($result instanceof Result ? $result->fetchOne() : $stmt->fetchColumn());
221+
return (bool) ($result instanceof DriverResult ? $result->fetchOne() : $stmt->fetchColumn());
221222
}
222223

223224
/**
@@ -339,7 +340,7 @@ protected function doSave(array $values, $lifetime)
339340
foreach ($serialized as $id => $data) {
340341
$result = $stmt->execute();
341342

342-
if (null === $driver && !($result instanceof Result ? $result->rowCount() : $stmt->rowCount())) {
343+
if (null === $driver && !($result instanceof DriverResult ? $result->rowCount() : $stmt->rowCount())) {
343344
try {
344345
$insertStmt->execute();
345346
} catch (DBALException $e) {

0 commit comments

Comments
 (0)
0