From f61d3247db160c875a2e1893aaee519963830f99 Mon Sep 17 00:00:00 2001 From: Ondrej Mirtes Date: Wed, 20 Nov 2024 09:27:30 +0100 Subject: [PATCH] Patch wrong namespace prefixing in PHAR in WindowsRegistryLogicalFinder --- compiler/build/scoper.inc.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/compiler/build/scoper.inc.php b/compiler/build/scoper.inc.php index 0ea6df31ec..ba198a0c91 100644 --- a/compiler/build/scoper.inc.php +++ b/compiler/build/scoper.inc.php @@ -218,6 +218,12 @@ function (string $filePath, string $prefix, string $content): string { return str_replace(sprintf('use %s\\PhpParser;', $prefix), 'use PhpParser;', $content); }, + function (string $filePath, string $prefix, string $content): string { + if ($filePath !== 'vendor/fidry/cpu-core-counter/src/Finder/WindowsRegistryLogicalFinder.php') { + return $content; + } + return str_replace(sprintf('%s\\\\reg query', $prefix), 'reg query', $content); + }, ], 'exclude-namespaces' => [ 'PHPStan',