Skip to content

Commit a59ac4c

Browse files
martenbf3l1x
authored andcommitted
fix: universal Nette\Caching\Storages\Journal cleaning (#37)
1 parent c2647d9 commit a59ac4c

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/Module/NetteDIModule.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,13 @@
55
use Codeception\Module;
66
use Codeception\TestInterface;
77
use Nette\Bootstrap\Configurator;
8+
use Nette\Caching\Cache;
89
use Nette\Caching\Storages\Journal;
9-
use Nette\Caching\Storages\SQLiteJournal;
1010
use Nette\DI\Container;
1111
use Nette\DI\Extensions\ExtensionsExtension;
1212
use Nette\DI\MissingServiceException;
1313
use Nette\Http\Session;
1414
use Nette\Utils\FileSystem;
15-
use ReflectionProperty;
1615

1716
class NetteDIModule extends Module
1817
{
@@ -204,11 +203,7 @@ private function stopContainer(): void
204203

205204
try {
206205
$journal = $this->container->getByType(Journal::class);
207-
if ($journal instanceof SQLiteJournal) {
208-
$property = new ReflectionProperty(SQLiteJournal::class, 'pdo');
209-
$property->setAccessible(true);
210-
$property->setValue($journal, null);
211-
}
206+
$journal->clean([Cache::All => true]);
212207
} catch (MissingServiceException $e) {
213208
// IJournal is optional
214209
}

0 commit comments

Comments
 (0)