From 8182d515fbe58e0397f13c4d7d3540a14c52331e Mon Sep 17 00:00:00 2001 From: Sebastian Bergmann Date: Thu, 4 Apr 2024 09:30:53 +0200 Subject: [PATCH 1/3] Tweak whitespace --- build/config/php-scoper.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build/config/php-scoper.php b/build/config/php-scoper.php index 14609a8e054..99d637c7a40 100644 --- a/build/config/php-scoper.php +++ b/build/config/php-scoper.php @@ -13,9 +13,11 @@ 'PHPUnit', 'Prophecy' ], + 'expose-classes' => [ '/^PHP_Token.*$/' ], + 'expose-constants' => [ '/^__PHPUNIT_.+$/' ], From 01b6e09fd2f62de5b5f64f4b9efc67fecff701d0 Mon Sep 17 00:00:00 2001 From: Sebastian Bergmann Date: Thu, 4 Apr 2024 09:36:39 +0200 Subject: [PATCH 2/3] Move prefix configuration to configuration file --- build.xml | 2 -- build/config/php-scoper.php | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build.xml b/build.xml index 11c05951ddd..f48755065c1 100644 --- a/build.xml +++ b/build.xml @@ -327,8 +327,6 @@ - - diff --git a/build/config/php-scoper.php b/build/config/php-scoper.php index 99d637c7a40..7cd9c05316d 100644 --- a/build/config/php-scoper.php +++ b/build/config/php-scoper.php @@ -9,6 +9,8 @@ */ return [ + 'prefix' => 'PHPUnit', + 'exclude-namespaces' => [ 'PHPUnit', 'Prophecy' From 4d829e0740db0cbcbcd39ec5656161b4326004a4 Mon Sep 17 00:00:00 2001 From: Sebastian Bergmann Date: Thu, 4 Apr 2024 09:38:24 +0200 Subject: [PATCH 3/3] Use PHPUnitPHAR as prefix instead of PHPUnit as we may want to prefix some symbols where their name begins with PHPUnit\ in the future --- .github/workflows/ci.yaml | 2 +- build.xml | 6 +++--- build/config/php-scoper.php | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 110c923b2ca..08d5bff3417 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -264,7 +264,7 @@ jobs: run: ant phar-snapshot - name: Check whether PHAR is scoped - run: grep -q PHPUnit\\\\DeepCopy\\\\Exception\\\\CloneException build/artifacts/phpunit-snapshot.phar || (echo "phpunit-snapshot.phar is not scoped." && false) + run: grep -q PHPUnitPHAR\\\\DeepCopy\\\\Exception\\\\CloneException build/artifacts/phpunit-snapshot.phar || (echo "phpunit-snapshot.phar is not scoped." && false) - name: Upload PHAR uses: actions/upload-artifact@v4 diff --git a/build.xml b/build.xml index f48755065c1..40b267ad2b6 100644 --- a/build.xml +++ b/build.xml @@ -330,9 +330,9 @@ - - - + + + diff --git a/build/config/php-scoper.php b/build/config/php-scoper.php index 7cd9c05316d..1bffc7e21b5 100644 --- a/build/config/php-scoper.php +++ b/build/config/php-scoper.php @@ -9,7 +9,7 @@ */ return [ - 'prefix' => 'PHPUnit', + 'prefix' => 'PHPUnitPHAR', 'exclude-namespaces' => [ 'PHPUnit',