Skip to content

Commit

Permalink
Update PHP-Scoper (#255)
Browse files Browse the repository at this point in the history
  • Loading branch information
theofidry authored Jun 9, 2018
1 parent 5aa3c42 commit ba5958b
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 17 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"composer/composer": "^1.6",
"composer/xdebug-handler": "^1.1.0",
"herrera-io/annotations": "~1.0",
"humbug/php-scoper": "dev-master#4f40b5a",
"humbug/php-scoper": "^0.8",
"justinrainbow/json-schema": "^5.2",
"nikic/iter": "^1.6",
"ocramius/package-versions": "^1.3",
Expand Down
13 changes: 6 additions & 7 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/PhpScoper/NullScoper.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function scope(string $filePath, string $contents): string
*/
public function getWhitelist(): Whitelist
{
return Whitelist::create();
return Whitelist::create(true);
}

public function getPrefix(): string
Expand Down
10 changes: 5 additions & 5 deletions tests/Composer/ComposerOrchestratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public function test_it_can_dump_the_autoloader_with_a_composer_json_with_a_depe
{
mirror(self::FIXTURES.'/dir000', $this->tmp);

ComposerOrchestrator::dumpAutoload(Whitelist::create(), '');
ComposerOrchestrator::dumpAutoload(Whitelist::create(true), '');

$expectedPaths = [
'composer.json',
Expand Down Expand Up @@ -346,7 +346,7 @@ public function provideComposerAutoload()
$composerAutoloaderName = self::COMPOSER_AUTOLOADER_NAME;

yield [
Whitelist::create(),
Whitelist::create(true),
'',
<<<PHP
<?php
Expand All @@ -361,7 +361,7 @@ public function provideComposerAutoload()
];

yield [
Whitelist::create('Acme\Foo'), // Whitelist is ignored when prefix is empty
Whitelist::create(true, 'Acme\Foo'), // Whitelist is ignored when prefix is empty
'',
<<<PHP
<?php
Expand All @@ -376,7 +376,7 @@ public function provideComposerAutoload()
];

yield [
Whitelist::create(),
Whitelist::create(true),
'_Box',
<<<PHP
<?php
Expand All @@ -391,7 +391,7 @@ public function provideComposerAutoload()
];

yield [
Whitelist::create('Acme\Foo'),
Whitelist::create(true, 'Acme\Foo'),
'_Box',
<<<PHP
<?php
Expand Down
2 changes: 1 addition & 1 deletion tests/PhpScoper/NullScoperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@ public function test_it_exposes_some_elements_of_the_scoping_config(): void
$scoper = new NullScoper();

$this->assertSame('', $scoper->getPrefix());
$this->assertEquals(Whitelist::create(), $scoper->getWhitelist());
$this->assertEquals(Whitelist::create(true), $scoper->getWhitelist());
}
}
4 changes: 2 additions & 2 deletions tests/PhpScoper/SimpleScoperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function test_it_scopes_the_file_content(): void
JSON;

$prefix = 'HumbugBox';
$whitelist = Whitelist::create('Whitelisted\Foo');
$whitelist = Whitelist::create(true, 'Whitelisted\Foo');
$patchers = [];

/** @var ObjectProphecy|PhpScoper $phpScoperProphecy */
Expand All @@ -63,7 +63,7 @@ public function test_it_scopes_the_file_content(): void
public function test_it_exposes_some_elements_of_the_scoping_config(): void
{
$prefix = 'HumbugBox';
$whitelist = Whitelist::create('Whitelisted\Foo');
$whitelist = Whitelist::create(true, 'Whitelisted\Foo');
$patchers = [];

$scoper = new SimpleScoper(new FakePhpScoper(), $prefix, $whitelist, $patchers);
Expand Down

0 comments on commit ba5958b

Please sign in to comment.