From a2d6da8b4e5f3058dd95b4db2d173682b250896e Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Fri, 27 May 2022 18:45:03 +0700 Subject: [PATCH] Back to php-scoper 0.14 with scoping from php 8.0 (#2370) --- .github/workflows/build_scoped_rector.yaml | 11 +++++++++++ build/build-rector-scoped.sh | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_scoped_rector.yaml b/.github/workflows/build_scoped_rector.yaml index 158efd5d675..b6701e12c4b 100644 --- a/.github/workflows/build_scoped_rector.yaml +++ b/.github/workflows/build_scoped_rector.yaml @@ -58,6 +58,17 @@ jobs: # 2. downgrade rector - run: sh build/downgrade-rector.sh rector-build + # scoped using php-scoper.phar which require #[\ReturnTypeWillChange] inside so use php 8.0 for scoping + - + uses: shivammathur/setup-php@v2 + with: + php-version: 8.0 + coverage: none + + # fixes https://github.com/rectorphp/rector/pull/4559/checks?check_run_id=1359814403, see https://github.com/shivammathur/setup-php#composer-github-oauth + env: + COMPOSER_TOKEN: ${{ secrets.ACCESS_TOKEN }} + # 3. prefix classes - run: sh build/build-rector-scoped.sh rector-build rector-prefixed-downgraded diff --git a/build/build-rector-scoped.sh b/build/build-rector-scoped.sh index c2116e41c97..97db3a3c4ed 100644 --- a/build/build-rector-scoped.sh +++ b/build/build-rector-scoped.sh @@ -34,7 +34,7 @@ rm -f "$BUILD_DIRECTORY/phpstan-for-rector.neon" # 2. scope it note "Running scoper to $RESULT_DIRECTORY" -wget https://github.com/humbug/php-scoper/releases/download/0.17.2/php-scoper.phar -N --no-verbose +wget https://github.com/humbug/php-scoper/releases/download/0.14.0/php-scoper.phar -N --no-verbose # Work around possible PHP memory limits