Skip to content

Commit

Permalink
Improve tests
Browse files Browse the repository at this point in the history
  • Loading branch information
danog committed Apr 6, 2024
1 parent 4195f87 commit 14ad043
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/Internal/Driver/ObjectArray.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -68,12 +68,9 @@ public static function getInstance(DbArrayBuilder $config, DbArray|null $previou
$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<TTKey, TValue> */
return $previous->cache->inner;
// @codeCoverageIgnoreStart
throw new AssertionError("Impossible!");
// @codeCoverageIgnoreEnd
}
$previous->cache->startCacheCleanupLoop();
/** @var DbArray<TTKey, TValue> */
Expand Down

0 comments on commit 14ad043

Please sign in to comment.