diff --git a/src/Symfony/Component/Cache/Tests/Traits/PdoPruneableTrait.php b/src/Symfony/Component/Cache/Tests/Traits/PdoPruneableTrait.php index 113a2c28eb..c405de7039 100644 --- a/src/Symfony/Component/Cache/Tests/Traits/PdoPruneableTrait.php +++ b/src/Symfony/Component/Cache/Tests/Traits/PdoPruneableTrait.php @@ -11,8 +11,6 @@ namespace Symfony\Component\Cache\Tests\Traits; -use Doctrine\DBAL\Driver\Result; - trait PdoPruneableTrait { protected function isPruned($cache, $name) @@ -31,6 +29,6 @@ trait PdoPruneableTrait $select->bindValue(':id', sprintf('%%%s', $name)); $result = $select->execute(); - return 1 !== (int) ($result instanceof Result ? $result->fetchOne() : $select->fetch(\PDO::FETCH_COLUMN)); + return 1 !== (int) (\is_object($result) ? $result->fetchOne() : $select->fetch(\PDO::FETCH_COLUMN)); } } diff --git a/src/Symfony/Component/Cache/Traits/PdoTrait.php b/src/Symfony/Component/Cache/Traits/PdoTrait.php index 686d111d9b..917e8dd13f 100644 --- a/src/Symfony/Component/Cache/Traits/PdoTrait.php +++ b/src/Symfony/Component/Cache/Traits/PdoTrait.php @@ -11,10 +11,8 @@ namespace Symfony\Component\Cache\Traits; -use Doctrine\DBAL\Abstraction\Result; use Doctrine\DBAL\Connection; use Doctrine\DBAL\DBALException; -use Doctrine\DBAL\Driver\Result as DriverResult; use Doctrine\DBAL\Driver\ServerInfoAwareConnection; use Doctrine\DBAL\Schema\Schema; use Symfony\Component\Cache\Exception\InvalidArgumentException; @@ -187,7 +185,7 @@ trait PdoTrait } $result = $stmt->execute(); - if ($result instanceof Result) { + if (\is_object($result)) { $result = $result->iterateNumeric(); } else { $stmt->setFetchMode(\PDO::FETCH_NUM); @@ -226,7 +224,7 @@ trait PdoTrait $stmt->bindValue(':time', time(), \PDO::PARAM_INT); $result = $stmt->execute(); - return (bool) ($result instanceof DriverResult ? $result->fetchOne() : $stmt->fetchColumn()); + return (bool) (\is_object($result) ? $result->fetchOne() : $stmt->fetchColumn()); } /** @@ -352,7 +350,7 @@ trait PdoTrait foreach ($serialized as $id => $data) { $result = $stmt->execute(); - if (null === $driver && !($result instanceof DriverResult ? $result->rowCount() : $stmt->rowCount())) { + if (null === $driver && !(\is_object($result) ? $result->rowCount() : $stmt->rowCount())) { try { $insertStmt->execute(); } catch (DBALException $e) {