diff --git a/src/Psalm/Internal/Clause.php b/src/Psalm/Internal/Clause.php index 1e9c7dfbd..797fb5d3f 100644 --- a/src/Psalm/Internal/Clause.php +++ b/src/Psalm/Internal/Clause.php @@ -104,7 +104,7 @@ final class Clause implements Stringable /** @psalm-suppress ImpureFunctionCall */ $data = serialize($possibility_strings); - $this->hash = PHP_VERSION_ID >= 8_01_00 ? hash('xxh128', $data) : hash('md4', $data); + $this->hash = hash('xxh128', $data); } $this->possibilities = $possibilities; diff --git a/src/Psalm/Internal/Fork/PsalmRestarter.php b/src/Psalm/Internal/Fork/PsalmRestarter.php index 4350badbf..8c1d6bfa5 100644 --- a/src/Psalm/Internal/Fork/PsalmRestarter.php +++ b/src/Psalm/Internal/Fork/PsalmRestarter.php @@ -69,7 +69,7 @@ final class PsalmRestarter extends XdebugHandler $opcache_loaded = extension_loaded('opcache') || extension_loaded('Zend OPcache'); - if (PHP_VERSION_ID >= 8_00_00 && $opcache_loaded) { + if ($opcache_loaded) { // restart to enable JIT if it's not configured in the optimal way $opcache_settings = [ 'enable_cli' => in_array(ini_get('opcache.enable_cli'), ['1', 'true', true, 1]), @@ -145,11 +145,11 @@ final class PsalmRestarter extends XdebugHandler // if it wasn't loaded then we apparently don't have opcache installed and there's no point trying // to tweak it // If we're running on 7.4 there's no JIT available - if (PHP_VERSION_ID >= 8_00_00 && $opcache_loaded) { + if ($opcache_loaded) { $additional_options = [ '-dopcache.enable_cli=true', '-dopcache.jit_buffer_size=512M', - '-dopcache.jit=1205', + '-dopcache.jit=tracing', '-dopcache.optimization_level=0x7FFEBFFF', '-dopcache.preload=', '-dopcache.log_verbosity_level=0', diff --git a/src/Psalm/Internal/PhpVisitor/ReflectorVisitor.php b/src/Psalm/Internal/PhpVisitor/ReflectorVisitor.php index fd95f55fa..4497963b4 100644 --- a/src/Psalm/Internal/PhpVisitor/ReflectorVisitor.php +++ b/src/Psalm/Internal/PhpVisitor/ReflectorVisitor.php @@ -210,9 +210,7 @@ final class ReflectorVisitor extends PhpParser\NodeVisitorAbstract implements Fi $classlike_storage->class_implements['stringable'] = 'Stringable'; } - if (PHP_VERSION_ID >= 8_00_00) { - $this->codebase->scanner->queueClassLikeForScanning('Stringable'); - } + $this->codebase->scanner->queueClassLikeForScanning('Stringable'); } if (!$this->scan_deep) { diff --git a/src/Psalm/Internal/Provider/ClassLikeStorageCacheProvider.php b/src/Psalm/Internal/Provider/ClassLikeStorageCacheProvider.php index c35c5e382..75863abd8 100644 --- a/src/Psalm/Internal/Provider/ClassLikeStorageCacheProvider.php +++ b/src/Psalm/Internal/Provider/ClassLikeStorageCacheProvider.php @@ -106,7 +106,7 @@ class ClassLikeStorageCacheProvider private function getCacheHash(?string $_unused_file_path, ?string $file_contents): string { $data = $file_contents ?: $this->modified_timestamps; - return PHP_VERSION_ID >= 8_01_00 ? hash('xxh128', $data) : hash('md4', $data); + return hash('xxh128', $data); } private function loadFromCache(string $fq_classlike_name_lc, ?string $file_path): ?ClassLikeStorage @@ -152,7 +152,7 @@ class ClassLikeStorageCacheProvider $data = $file_path ? strtolower($file_path) . ' ' : ''; $data .= $fq_classlike_name_lc; - $file_path_sha = PHP_VERSION_ID >= 8_01_00 ? hash('xxh128', $data) : hash('md4', $data); + $file_path_sha = hash('xxh128', $data); return $parser_cache_directory . DIRECTORY_SEPARATOR diff --git a/src/Psalm/Internal/Provider/FileStorageCacheProvider.php b/src/Psalm/Internal/Provider/FileStorageCacheProvider.php index 8419afd80..e766769d7 100644 --- a/src/Psalm/Internal/Provider/FileStorageCacheProvider.php +++ b/src/Psalm/Internal/Provider/FileStorageCacheProvider.php @@ -113,7 +113,7 @@ class FileStorageCacheProvider // the timestamp is only needed if we don't have file contents // as same contents should give same results, independent of when file was modified $data = $file_contents ?: $this->modified_timestamps; - return PHP_VERSION_ID >= 8_01_00 ? hash('xxh128', $data) : hash('md4', $data); + return hash('xxh128', $data); } /** @@ -157,11 +157,7 @@ class FileStorageCacheProvider } } - if (PHP_VERSION_ID >= 8_01_00) { - $hash = hash('xxh128', $file_path); - } else { - $hash = hash('md4', $file_path); - } + $hash = hash('xxh128', $file_path); return $parser_cache_directory . DIRECTORY_SEPARATOR diff --git a/src/Psalm/Internal/Provider/ParserCacheProvider.php b/src/Psalm/Internal/Provider/ParserCacheProvider.php index a54c564f4..2125c190f 100644 --- a/src/Psalm/Internal/Provider/ParserCacheProvider.php +++ b/src/Psalm/Internal/Provider/ParserCacheProvider.php @@ -332,11 +332,7 @@ class ParserCacheProvider private function getParserCacheKey(string $file_path): string { - if (PHP_VERSION_ID >= 8_01_00) { - $hash = hash('xxh128', $file_path); - } else { - $hash = hash('md4', $file_path); - } + $hash = hash('xxh128', $file_path); return $hash . ($this->cache->use_igbinary ? '-igbinary' : '') . '-r'; } diff --git a/src/Psalm/Internal/Provider/ProjectCacheProvider.php b/src/Psalm/Internal/Provider/ProjectCacheProvider.php index 70167aaf5..0a162b94f 100644 --- a/src/Psalm/Internal/Provider/ProjectCacheProvider.php +++ b/src/Psalm/Internal/Provider/ProjectCacheProvider.php @@ -84,11 +84,7 @@ class ProjectCacheProvider return true; } - if (PHP_VERSION_ID >= 8_01_00) { - $hash = hash('xxh128', $lockfile_contents); - } else { - $hash = hash('md4', $lockfile_contents); - } + $hash = hash('xxh128', $lockfile_contents); } else { $hash = ''; } diff --git a/src/Psalm/Internal/Provider/StatementsProvider.php b/src/Psalm/Internal/Provider/StatementsProvider.php index b171cd645..471632e13 100644 --- a/src/Psalm/Internal/Provider/StatementsProvider.php +++ b/src/Psalm/Internal/Provider/StatementsProvider.php @@ -111,11 +111,7 @@ final class StatementsProvider $config = Config::getInstance(); - if (PHP_VERSION_ID >= 8_01_00) { - $file_content_hash = hash('xxh128', $version . $file_contents); - } else { - $file_content_hash = hash('md4', $version . $file_contents); - } + $file_content_hash = hash('xxh128', $version . $file_contents); if (!$this->parser_cache_provider || (!$config->isInProjectDirs($file_path) && strpos($file_path, 'vendor'))