Skip to content

Commit

Permalink
Update php-scoper and fix Symfony polyfill issues
Browse files Browse the repository at this point in the history
  • Loading branch information
stayallive committed Jan 31, 2021
1 parent 203aaf0 commit 9796e42
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
1 change: 0 additions & 1 deletion bin/scope-vendor-fix.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

$scoper_path = __DIR__ . '/../build/vendor/composer';


$static_loader_path = "{$scoper_path}/autoload_static.php";

echo " > Fixing {$static_loader_path}\n";
Expand Down
2 changes: 1 addition & 1 deletion bin/scope-vendor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ if [[ ! -e bin/php-scoper.phar ]]; then
echo " > Downloading php-scoper.phar"
echo ""

curl -sSL -o bin/php-scoper.phar https://github.com/humbug/php-scoper/releases/download/0.13.1/php-scoper.phar
curl -sSL -o bin/php-scoper.phar https://github.com/humbug/php-scoper/releases/download/0.14.0/php-scoper.phar
fi

echo " > Making sure composer vendor files are on the locked version"
Expand Down
20 changes: 16 additions & 4 deletions scoper.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@

use Isolated\Symfony\Component\Finder\Finder;

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

return [
'prefix' => 'WPSentry\\ScopedVendor',

Expand All @@ -27,13 +33,19 @@
],

'whitelist' => [
'Sentry\*',
'Monolog\*',
'Sentry\\*',
'Monolog\\*',
'Symfony\\Polyfill\\*',
],

'files-whitelist' => [
'files-whitelist' => array_merge( [
'vendor/ralouphie/getallheaders/src/getallheaders.php',
],
], array_map(
static function ( $file ) {
return $file->getPathName();
},
iterator_to_array( $polyfillsBootstrap )
) ),

'whitelist-global-classes' => true,
'whitelist-global-constants' => true,
Expand Down

0 comments on commit 9796e42

Please sign in to comment.