| Total Complexity | 5 |
| Total Lines | 20 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | class FileCachePathBuilder |
||
| 8 | { |
||
| 9 | public function __construct(private FileCacheManager $fileManager, private string $baseDir) |
||
| 10 | { |
||
| 11 | } |
||
| 12 | |||
| 13 | public function build(string $cacheKey, string $namespace = ''): string |
||
| 14 | { |
||
| 15 | $dir = $this->namespaceDir($namespace); |
||
| 16 | if (!empty($namespace)) { |
||
| 17 | $this->fileManager->createDirectory($dir); |
||
| 18 | } |
||
| 19 | return $dir . md5($cacheKey) . '.cache'; |
||
| 20 | } |
||
| 21 | |||
| 22 | public function namespaceDir(string $namespace = ''): string |
||
| 27 | } |
||
| 28 | } |
||
| 29 |