Skip to content
This repository has been archived by the owner on Dec 3, 2023. It is now read-only.

Fix symfony polyfills in scoper #2998

Conversation

pdelre
Copy link
Contributor

@pdelre pdelre commented Feb 24, 2021

This adds symfony/polyfill-* files and classes to php-scoper's allow lists. It addresses failure to load the polyfills detailed in #2973 & humbug/php-scoper#440.

I tested this locally with the following set of commands pulled from https://github.com/symplify/symplify/blob/master/.github/workflows/build_scoped_packages.yaml#L38.

Build Scoped Package

git clean -fdx && rm -rf vendor
composer update --no-progress --ansi
packages/monorepo-builder/bin/monorepo-builder localize-composer-paths packages/easy-coding-standard/composer.json --ansi
composer update --working-dir packages/easy-coding-standard --ansi --no-dev
vendor/bin/php-scoper add-prefix packages/easy-coding-standard --output-dir packages-scoped/easy-coding-standard --config packages/easy-coding-standard/scoper.inc.php --force --ansi
composer dump-autoload --working-dir packages-scoped/easy-coding-standard --ansi --optimize --classmap-authoritative
packages/package-scoper/bin/package-scoper scope-composer-json packages-scoped/easy-coding-standard/composer.json --ansi
chmod 777 ./packages-scoped/easy-coding-standard/bin/ecs

Verify no Fatals occur

cd packages-scoped/easy-coding-standard
./bin/ecs init
sed -i 's|// SetList::PSR_12|SetList::PSR_12|' ecs.php
./bin/ecs check ./bin/ecs.php)

@pdelre pdelre marked this pull request as draft February 24, 2021 20:47
@TomasVotruba
Copy link
Member

CI needs to pass before review

…mfony-polyfills-in-scoper

* upstream/master:
  [PHPStanRules]  Add NoNullablePropertyRule (deprecated-packages#2999)
  [Rector] Clean up rector config of skip MoveVariableDeclarationNearReferenceRector (deprecated-packages#3000)
@@ -478,3 +478,9 @@ parameters:
- packages/git-wrapper/src
- packages/set-config-resolver/src/ConfigResolver.php
- packages/set-config-resolver/src/SetAwareConfigResolver.php

# needed as `humbug/php-scoper` provides `Isolated\Symfony\Component\Finder\Finder`
Copy link
Contributor Author

@pdelre pdelre Feb 25, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I realize I've taken a liberty here, but I was unable to find a way to address humbug/php-scoper's expected Isolated\Symfony\Component\Finder\Finder usage.

@pdelre pdelre marked this pull request as ready for review February 26, 2021 19:48
@TomasVotruba TomasVotruba enabled auto-merge (squash) March 1, 2021 11:45
@TomasVotruba
Copy link
Member

Thank you 👍

@TomasVotruba TomasVotruba merged commit 9d58e23 into deprecated-packages:master Mar 1, 2021
@pdelre pdelre deleted the issue-2973-fix-symfony-polyfills-in-scoper branch March 1, 2021 13:51
@TomasVotruba
Copy link
Member

I'm just building ECS prefixed and this does not work as expected.

Good news, we're not alone :) php-scoper is full of reports with same issues humbug/php-scoper#440

Some fixes from dev-master of php-scoper might help, but it has not been tagged yet :/

Another attempt: a58433f

@deprecated-packages deprecated-packages locked as resolved and limited conversation to collaborators May 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants