Skip to content

Commit b6c3b89

Browse files
committed
✨ Add cache config
1 parent 34b3820 commit b6c3b89

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

src/Tempest/Console/src/Commands/MakeConfigCommand.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ private function getStubFileFromConfigType(ConfigType $configType): StubFile
6565
$stubPath = dirname( __DIR__ ) . '/Stubs';
6666

6767
return match ($configType) {
68+
ConfigType::CACHE => StubFile::from( $stubPath . '/cache.config.stub.php'),
6869
ConfigType::LOG => StubFile::from( $stubPath . '/log.config.stub.php'),
6970
ConfigType::COMMAND_BUS => StubFile::from( $stubPath . '/command-bus.config.stub.php'),
7071
ConfigType::EVENT_BUS => StubFile::from( $stubPath . '/event-bus.config.stub.php'),

src/Tempest/Console/src/Enums/ConfigType.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ enum ConfigType: string
1616
case EVENT_BUS = 'event-bus';
1717
case COMMAND_BUS = 'command-bus';
1818
case LOG = 'log';
19+
case CACHE = 'cache';
1920
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use Symfony\Component\Cache\Adapter\FilesystemAdapter;
6+
use Tempest\Cache\CacheConfig;
7+
8+
return new CacheConfig(
9+
projectCachePool: new FilesystemAdapter(
10+
directory: __DIR__ . '/../../../../.cache'
11+
)
12+
);

0 commit comments

Comments
 (0)