Skip to content

Commit

Permalink
Stop scoping Symfony polyfills.
Browse files Browse the repository at this point in the history
  • Loading branch information
bobthecow committed Nov 23, 2021
1 parent d970e52 commit dc0085b
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions scoper.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,44 @@
* file that was distributed with this source code.
*/

use Symfony\Component\Finder\Finder;

$polyfillsBootstraps = \array_map(
function (SplFileInfo $fileInfo) {
return $fileInfo->getPathname();
},
\iterator_to_array(
Finder::create()
->files()
->in(__DIR__.'/vendor/symfony/polyfill-*')
->name('bootstrap.php'),
false,
),
);

$polyfillsStubs = [];

try {
$polyfillsStubs = \array_map(
function (SplFileInfo $fileInfo) {
return $fileInfo->getPathname();
},
\iterator_to_array(
Finder::create()
->files()
->in(__DIR__.'/vendor/symfony/polyfill-*/Resources/stubs')
->name('*.php'),
false,
),
);
} catch (Throwable $e) {
// There may not be any stubs?
}

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

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

'files-whitelist' => \array_merge($polyfillsBootstraps, $polyfillsStubs),

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

0 comments on commit dc0085b

Please sign in to comment.