Skip to content

Commit 744a779

Browse files
committed
[+]: "PhpCodeParser" -> fix cache key
1 parent be8755d commit 744a779

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/voku/SimplePhpParser/Parsers/PhpCodeParser.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ public static function process(
254254
*/
255255
public static function file_get_contents_with_cache(string $fileName, Cache $cache): array
256256
{
257-
$cacheKey = 'simple-php-code-parser-' . \md5($fileName) . '--' . \filemtime($fileName);
257+
$cacheKey = 'simple-php-code-parser-' . \md5($fileName) . '--' . \filemtime($fileName) . '--' . \PHP_VERSION;
258258

259259
if ($cache->getCacheIsReady() === true && $cache->existsItem($cacheKey)) {
260260
return $cache->getItem($cacheKey);
@@ -299,7 +299,7 @@ private static function getCode(
299299
new RecursiveDirectoryIterator($pathOrCode, FilesystemIterator::SKIP_DOTS)
300300
);
301301
} else {
302-
$cacheKey = 'simple-php-code-parser-' . \md5($pathOrCode);
302+
$cacheKey = 'simple-php-code-parser-' . \md5($pathOrCode) . '--' . \PHP_VERSION;
303303

304304
$phpCodes[$cacheKey]['content'] = $pathOrCode;
305305
$phpCodes[$cacheKey]['fileName'] = null;

0 commit comments

Comments
 (0)