diff --git a/src/Caching/ValueObject/Storage/FileCacheStorage.php b/src/Caching/ValueObject/Storage/FileCacheStorage.php index b883cb4b9ae..3a7a31cbb40 100644 --- a/src/Caching/ValueObject/Storage/FileCacheStorage.php +++ b/src/Caching/ValueObject/Storage/FileCacheStorage.php @@ -6,7 +6,6 @@ use FilesystemIterator; use Nette\Utils\FileSystem; -use Nette\Utils\Random; use Rector\Caching\Contract\ValueObject\Storage\CacheStorageInterface; use Rector\Caching\ValueObject\CacheFilePaths; use Rector\Caching\ValueObject\CacheItem; @@ -55,7 +54,6 @@ public function save(string $key, string $variableKey, mixed $data): void $filePath = $cacheFilePaths->getFilePath(); - $tmpPath = \sprintf('%s/%s.tmp', $this->directory, Random::generate()); $errorBefore = \error_get_last(); $exported = @\var_export(new CacheItem($variableKey, $data), true); $errorAfter = \error_get_last(); @@ -68,18 +66,12 @@ public function save(string $key, string $variableKey, mixed $data): void )); } - // for performance reasons we don't use SmartFileSystem - FileSystem::write($tmpPath, \sprintf("filesystem->dumpFile( + $filePath, + \sprintf("