|
21 | 21 | use Phauthentic\CognitiveCodeAnalysis\Business\Cognitive\ScoreCalculator; |
22 | 22 | use Phauthentic\CognitiveCodeAnalysis\Business\MetricsFacade; |
23 | 23 | use Phauthentic\CognitiveCodeAnalysis\Business\Utility\DirectoryScanner; |
| 24 | +use Phauthentic\CognitiveCodeAnalysis\Cache\FileCache; |
24 | 25 | use Phauthentic\CognitiveCodeAnalysis\Command\ChurnCommand; |
25 | 26 | use Phauthentic\CognitiveCodeAnalysis\Command\ChurnSpecifications\ChurnValidationSpecificationFactory; |
26 | 27 | use Phauthentic\CognitiveCodeAnalysis\Command\CognitiveMetricsCommand; |
|
42 | 43 | use PhpParser\NodeTraverser; |
43 | 44 | use PhpParser\NodeTraverserInterface; |
44 | 45 | use PhpParser\ParserFactory; |
| 46 | +use Psr\Cache\CacheItemPoolInterface; |
45 | 47 | use Symfony\Component\Config\Definition\Processor; |
46 | 48 | use Symfony\Component\Console\Application as SymfonyApplication; |
47 | 49 | use Symfony\Component\Console\Input\ArgvInput; |
@@ -99,6 +101,12 @@ private function registerCoreServices(): void |
99 | 101 | $this->containerBuilder->register(ConfigService::class, ConfigService::class) |
100 | 102 | ->setPublic(true); |
101 | 103 |
|
| 104 | + $this->containerBuilder->register(CacheItemPoolInterface::class, FileCache::class) |
| 105 | + ->setArguments([ |
| 106 | + './.phpcca.cache' // Default cache directory, can be overridden by config |
| 107 | + ]) |
| 108 | + ->setPublic(true); |
| 109 | + |
102 | 110 | $this->containerBuilder->register(Baseline::class, Baseline::class) |
103 | 111 | ->setPublic(true); |
104 | 112 |
|
@@ -242,7 +250,8 @@ private function bootstrapMetricsCollectors(): void |
242 | 250 | new Reference(Parser::class), |
243 | 251 | new Reference(DirectoryScanner::class), |
244 | 252 | new Reference(ConfigService::class), |
245 | | - new Reference(MessageBusInterface::class) |
| 253 | + new Reference(MessageBusInterface::class), |
| 254 | + new Reference(CacheItemPoolInterface::class) |
246 | 255 | ]) |
247 | 256 | ->setPublic(true); |
248 | 257 | } |
|
0 commit comments