| Total Complexity | 6 |
| Total Lines | 28 |
| Duplicated Lines | 0 % |
| Coverage | 90.91% |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | abstract class AbstractJsonFileProfiler implements FileProfilerInterface |
||
| 12 | { |
||
| 13 | private string $cacheDir; |
||
| 14 | |||
| 15 | 4 | public function __construct(string $cacheDir) |
|
| 18 | } |
||
| 19 | |||
| 20 | 2 | public function updateProfiler(array $cache): void |
|
| 21 | { |
||
| 22 | 2 | $fileContent = json_encode($cache, JSON_THROW_ON_ERROR | JSON_PRETTY_PRINT); |
|
| 23 | |||
| 24 | 2 | file_put_contents($this->getAbsoluteCacheFilename(), $fileContent); |
|
| 25 | } |
||
| 26 | |||
| 27 | abstract protected function getCacheFilename(): string; |
||
| 28 | |||
| 29 | 2 | private function getAbsoluteCacheFilename(): string |
|
| 39 | } |
||
| 40 | } |
||
| 41 |