Skip to content

Commit 14ad043

Browse files
committed
Improve tests
1 parent 4195f87 commit 14ad043

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/Internal/Driver/ObjectArray.php

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@
2525

2626
namespace danog\AsyncOrm\Internal\Driver;
2727

28+
use AssertionError;
2829
use danog\AsyncOrm\DbArray;
2930
use danog\AsyncOrm\DbArrayBuilder;
3031
use danog\AsyncOrm\DbObject;
31-
use danog\AsyncOrm\Driver\MemoryArray;
3232
use danog\AsyncOrm\Internal\Containers\ObjectContainer;
3333
use danog\AsyncOrm\Settings\DriverSettings;
3434
use Traversable;
@@ -68,12 +68,9 @@ public static function getInstance(DbArrayBuilder $config, DbArray|null $previou
6868
$previous->cache->config = $config;
6969
$previous->cache->cacheTtl = $config->settings->cacheTtl;
7070
} else {
71-
$previous = new self($new::getInstance($config, $previous), $config, $config->settings->cacheTtl);
72-
}
73-
if ($previous->cache->inner instanceof MemoryArray) {
74-
$previous->cache->flushCache();
75-
/** @var DbArray<TTKey, TValue> */
76-
return $previous->cache->inner;
71+
// @codeCoverageIgnoreStart
72+
throw new AssertionError("Impossible!");
73+
// @codeCoverageIgnoreEnd
7774
}
7875
$previous->cache->startCacheCleanupLoop();
7976
/** @var DbArray<TTKey, TValue> */

0 commit comments

Comments
 (0)