<?php public function getCacheFile(string $key): string
{
if (! is_dir($this->cacheDirectory) && ! mkdir($this->cacheDirectory, 0755, true)) {
throw new RuntimeException("Could not create cache directory: {$this->cacheDirectory}");
}
<?php it('should be possible to use other cache directories', function (): void {
$dir = __DIR__.'/../../.peck-test.cache';
if (is_dir($dir)) {
foreach (array_diff(scandir($dir), ['.', '..']) as $file) {
unlink("{$dir}/{$file}");
}
<?php it('should return null when cache file exists but is not readable', function (): void {
$dir = __DIR__.'/../../.peck-test.cache';
if (is_dir($dir)) {
foreach (array_diff(scandir($dir), ['.', '..']) as $file) {
unlink("{$dir}/{$file}");
}