Skip to content

Commit

Permalink
Use PHP-Scoper prefix
Browse files Browse the repository at this point in the history
As per humbug/php-scoper#178, it is possible to configure the prefix in PHP-Scoper in which case the prefix should be re-used here instead of always generating a random one.
  • Loading branch information
theofidry committed May 18, 2018
1 parent 0be633c commit 8e41b5d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -1263,10 +1263,17 @@ function (string $class) use ($raw, $basePath): Compactor {
if (PhpScoperCompactor::class === $class) {
$phpScoperConfig = self::retrievePhpScoperConfig($raw, $basePath);

$phpScoperConfig = self::retrievePhpScoperConfig($raw, $basePath);

$prefix = null === $phpScoperConfig->getPrefix()
? uniqid('_HumbugBox', false)
: $phpScoperConfig->getPrefix()
;

return new PhpScoperCompactor(
new SimpleScoper(
create_scoper(),
uniqid('_HumbugBox', false),
$prefix,
$phpScoperConfig->getWhitelist(),
$phpScoperConfig->getPatchers()
)
Expand Down

0 comments on commit 8e41b5d

Please sign in to comment.