Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions src/Autoload/ScoperAutoloadGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,14 @@ final class ScoperAutoloadGenerator
{
// TODO: aliasing functions could be done via a single function to reduce boiler-template.

// TODO: doc link
private const EXPOSED_FUNCTIONS_DOC = <<<'EOF'
// Exposed functions. For more information see:
// https://github.com/humbug/php-scoper/blob/master/README.md#functions-whitelisting
// https://github.com/humbug/php-scoper/blob/master/docs/configuration.md#exposing-functions
EOF;

// TODO: doc link
private const EXPOSED_CLASSES_DOC = <<<'EOF'
// Exposed classes. For more information see:
// https://github.com/humbug/php-scoper/blob/master/README.md#class-whitelisting
// https://github.com/humbug/php-scoper/blob/master/docs/configuration.md#exposing-classes
EOF;

private static string $eol;
Expand Down
16 changes: 8 additions & 8 deletions tests/Autoload/ScoperAutoloadGeneratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public static function provideRegistry(): iterable
$loader = require_once __DIR__.'/autoload.php';

// Exposed functions. For more information see:
// https://github.com/humbug/php-scoper/blob/master/README.md#functions-whitelisting
// https://github.com/humbug/php-scoper/blob/master/docs/configuration.md#exposing-functions
if (!function_exists('foo')) {
function foo() {
return \Humbug\foo(...func_get_args());
Expand Down Expand Up @@ -100,7 +100,7 @@ function bar() {
}

// Exposed functions. For more information see:
// https://github.com/humbug/php-scoper/blob/master/README.md#functions-whitelisting
// https://github.com/humbug/php-scoper/blob/master/docs/configuration.md#exposing-functions
namespace Acme {
if (!function_exists('Acme\foo')) {
function foo() {
Expand Down Expand Up @@ -145,7 +145,7 @@ function baz() {
$loader = require_once __DIR__.'/autoload.php';

// Exposed classes. For more information see:
// https://github.com/humbug/php-scoper/blob/master/README.md#class-whitelisting
// https://github.com/humbug/php-scoper/blob/master/docs/configuration.md#exposing-classes
if (!class_exists('A\Foo', false) && !interface_exists('A\Foo', false) && !trait_exists('A\Foo', false)) {
spl_autoload_call('Humbug\A\Foo');
}
Expand All @@ -171,7 +171,7 @@ function baz() {
$loader = require_once __DIR__.'/autoload.php';

// Exposed classes. For more information see:
// https://github.com/humbug/php-scoper/blob/master/README.md#class-whitelisting
// https://github.com/humbug/php-scoper/blob/master/docs/configuration.md#exposing-classes
if (!class_exists('Foo', false) && !interface_exists('Foo', false) && !trait_exists('Foo', false)) {
spl_autoload_call('Humbug\Foo');
}
Expand Down Expand Up @@ -207,15 +207,15 @@ function baz() {
}

// Exposed classes. For more information see:
// https://github.com/humbug/php-scoper/blob/master/README.md#class-whitelisting
// https://github.com/humbug/php-scoper/blob/master/docs/configuration.md#exposing-classes
namespace {
if (!class_exists('A\Foo', false) && !interface_exists('A\Foo', false) && !trait_exists('A\Foo', false)) {
spl_autoload_call('Humbug\A\Foo');
}
}

// Exposed functions. For more information see:
// https://github.com/humbug/php-scoper/blob/master/README.md#functions-whitelisting
// https://github.com/humbug/php-scoper/blob/master/docs/configuration.md#exposing-functions
namespace {
if (!function_exists('foo')) {
function foo() {
Expand Down Expand Up @@ -275,7 +275,7 @@ function baz() {
$loader = require_once __DIR__.'/autoload.php';

// Exposed functions. For more information see:
// https://github.com/humbug/php-scoper/blob/master/README.md#functions-whitelisting
// https://github.com/humbug/php-scoper/blob/master/docs/configuration.md#exposing-functions
if (!function_exists('__autoload')) {
function __autoload($className) {
return \Humbug\__autoload(...func_get_args());
Expand Down Expand Up @@ -306,7 +306,7 @@ function __autoload($className) {
}

// Exposed functions. For more information see:
// https://github.com/humbug/php-scoper/blob/master/README.md#functions-whitelisting
// https://github.com/humbug/php-scoper/blob/master/docs/configuration.md#exposing-functions
namespace {
if (!function_exists('__autoload')) {
function __autoload($className) {
Expand Down