|
11 | 11 |
|
12 | 12 | namespace Symfony\Component\Cache\Traits;
|
13 | 13 |
|
14 |
| -use Doctrine\DBAL\Abstraction\Result; |
15 | 14 | use Doctrine\DBAL\Connection;
|
16 | 15 | use Doctrine\DBAL\DBALException;
|
17 |
| -use Doctrine\DBAL\Driver\Result as DriverResult; |
18 | 16 | use Doctrine\DBAL\Driver\ServerInfoAwareConnection;
|
19 | 17 | use Doctrine\DBAL\Schema\Schema;
|
20 | 18 | use Symfony\Component\Cache\Exception\InvalidArgumentException;
|
@@ -187,7 +185,7 @@ protected function doFetch(array $ids)
|
187 | 185 | }
|
188 | 186 | $result = $stmt->execute();
|
189 | 187 |
|
190 |
| - if ($result instanceof Result) { |
| 188 | + if (\is_object($result)) { |
191 | 189 | $result = $result->iterateNumeric();
|
192 | 190 | } else {
|
193 | 191 | $stmt->setFetchMode(\PDO::FETCH_NUM);
|
@@ -226,7 +224,7 @@ protected function doHave($id)
|
226 | 224 | $stmt->bindValue(':time', time(), \PDO::PARAM_INT);
|
227 | 225 | $result = $stmt->execute();
|
228 | 226 |
|
229 |
| - return (bool) ($result instanceof DriverResult ? $result->fetchOne() : $stmt->fetchColumn()); |
| 227 | + return (bool) (\is_object($result) ? $result->fetchOne() : $stmt->fetchColumn()); |
230 | 228 | }
|
231 | 229 |
|
232 | 230 | /**
|
@@ -352,7 +350,7 @@ protected function doSave(array $values, $lifetime)
|
352 | 350 | foreach ($serialized as $id => $data) {
|
353 | 351 | $result = $stmt->execute();
|
354 | 352 |
|
355 |
| - if (null === $driver && !($result instanceof DriverResult ? $result->rowCount() : $stmt->rowCount())) { |
| 353 | + if (null === $driver && !(\is_object($result) ? $result->rowCount() : $stmt->rowCount())) { |
356 | 354 | try {
|
357 | 355 | $insertStmt->execute();
|
358 | 356 | } catch (DBALException $e) {
|
|
0 commit comments