Skip to content

Commit

Permalink
Exclude Symfony polyfills from php-scoper isolation.
Browse files Browse the repository at this point in the history
  • Loading branch information
bobthecow committed Apr 17, 2021
1 parent 3413bb6 commit 40638d0
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions scoper.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,17 @@
* file that was distributed with this source code.
*/

use Isolated\Symfony\Component\Finder\Finder;

$polyfillsBootstrap = Finder::create()
->files()
->in(__DIR__.'/vendor/symfony/polyfill-*')
->name('bootstrap.php');

return [
'whitelist' => [
'Psy\*',
'Symfony\Polyfill\*',

// Old Hoa global functions
'from',
Expand All @@ -21,6 +29,13 @@
'curry_ref',
],

'files-whitelist' => \array_map(
static function ($file) {
return $file->getPathName();
},
\iterator_to_array($polyfillsBootstrap)
),

'patchers' => [
// Un-patch overly enthusiastic internal constant patching.
// https://github.com/humbug/php-scoper/issues/356
Expand Down

1 comment on commit 40638d0

@bobthecow
Copy link
Owner Author

Choose a reason for hiding this comment

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

@theofidry any idea where I'm going wrong here? it seems like this should be fixing polyfills but if i build under PHP 7.3 (with the appropriate composer config) and try to execute in 7.2 it blows up :-/

Please sign in to comment.