From 14ad043cd87621e55baa846c29b4fa975f111bb2 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Sat, 6 Apr 2024 20:01:56 +0200 Subject: [PATCH] Improve tests --- src/Internal/Driver/ObjectArray.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/Internal/Driver/ObjectArray.php b/src/Internal/Driver/ObjectArray.php index 1de4cd4..ce6e6b4 100644 --- a/src/Internal/Driver/ObjectArray.php +++ b/src/Internal/Driver/ObjectArray.php @@ -25,10 +25,10 @@ namespace danog\AsyncOrm\Internal\Driver; +use AssertionError; use danog\AsyncOrm\DbArray; use danog\AsyncOrm\DbArrayBuilder; use danog\AsyncOrm\DbObject; -use danog\AsyncOrm\Driver\MemoryArray; use danog\AsyncOrm\Internal\Containers\ObjectContainer; use danog\AsyncOrm\Settings\DriverSettings; use Traversable; @@ -68,12 +68,9 @@ final class ObjectArray extends DbArray $previous->cache->config = $config; $previous->cache->cacheTtl = $config->settings->cacheTtl; } else { - $previous = new self($new::getInstance($config, $previous), $config, $config->settings->cacheTtl); - } - if ($previous->cache->inner instanceof MemoryArray) { - $previous->cache->flushCache(); - /** @var DbArray */ - return $previous->cache->inner; + // @codeCoverageIgnoreStart + throw new AssertionError("Impossible!"); + // @codeCoverageIgnoreEnd } $previous->cache->startCacheCleanupLoop(); /** @var DbArray */