Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed scoper-autoload.php being incompatible with PHP 5 #846

Merged
merged 2 commits into from
Sep 30, 2023
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
2 changes: 1 addition & 1 deletion src/Autoload/ScoperAutoloadGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ final class ScoperAutoloadGenerator

private const EXPOSE_CLASS_DECLARATION = <<<'PHP'
if (!function_exists('humbug_phpscoper_expose_class')) {
function humbug_phpscoper_expose_class(string $exposed, string $prefixed): void {
function humbug_phpscoper_expose_class($exposed, $prefixed) {
if (!class_exists($exposed, false) && !interface_exists($exposed, false) && !trait_exists($exposed, false)) {
spl_autoload_call($prefixed);
}
Expand Down
6 changes: 3 additions & 3 deletions tests/Autoload/ScoperAutoloadGeneratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ public static function provideRegistry(): iterable
// Class aliases. For more information see:
// https://github.com/humbug/php-scoper/blob/master/docs/further-reading.md#class-aliases
if (!function_exists('humbug_phpscoper_expose_class')) {
function humbug_phpscoper_expose_class(string $exposed, string $prefixed): void {
function humbug_phpscoper_expose_class($exposed, $prefixed) {
if (!class_exists($exposed, false) && !interface_exists($exposed, false) && !trait_exists($exposed, false)) {
spl_autoload_call($prefixed);
}
Expand Down Expand Up @@ -326,7 +326,7 @@ function humbug_phpscoper_expose_class(string $exposed, string $prefixed): void
// Class aliases. For more information see:
// https://github.com/humbug/php-scoper/blob/master/docs/further-reading.md#class-aliases
if (!function_exists('humbug_phpscoper_expose_class')) {
function humbug_phpscoper_expose_class(string $exposed, string $prefixed): void {
function humbug_phpscoper_expose_class($exposed, $prefixed) {
if (!class_exists($exposed, false) && !interface_exists($exposed, false) && !trait_exists($exposed, false)) {
spl_autoload_call($prefixed);
}
Expand Down Expand Up @@ -381,7 +381,7 @@ function humbug_phpscoper_expose_class(string $exposed, string $prefixed): void
// https://github.com/humbug/php-scoper/blob/master/docs/further-reading.md#class-aliases
namespace {
if (!function_exists('humbug_phpscoper_expose_class')) {
function humbug_phpscoper_expose_class(string $exposed, string $prefixed): void {
function humbug_phpscoper_expose_class($exposed, $prefixed) {
if (!class_exists($exposed, false) && !interface_exists($exposed, false) && !trait_exists($exposed, false)) {
spl_autoload_call($prefixed);
}
Expand Down
Loading