Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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 @@ -306,7 +306,7 @@ private static function groupFunctionsByNamespace(array $exposedFunctions): arra
$originalFQ = new FullyQualified($exposed);

$namespace = $originalFQ->slice(0, -1);
$functionName = null === $namespace ? $exposed : (string) $originalFQ->slice(1);
$functionName = null === $namespace ? $exposed : (string) $originalFQ->slice(-1, 1);

$groupedFunctions[(string) $namespace][] = [$exposed, $functionName, $prefix];
}
Expand Down
2 changes: 1 addition & 1 deletion tests/AutoReview/GAE2ETest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class GAE2ETest extends TestCase

public function test_github_actions_executes_all_the_e2e_tests(): void
{
$expected = array_diff(E2ECollector::getE2ENames(), self::IGNORED_E2E_TESTS);
$expected = array_values(array_diff(E2ECollector::getE2ENames(), self::IGNORED_E2E_TESTS));
$actual = GAE2ECollector::getExecutedE2ETests();

self::assertEqualsCanonicalizing($expected, $actual);
Expand Down
5 changes: 5 additions & 0 deletions tests/Autoload/ScoperAutoloadGeneratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ public static function provideRegistry(): iterable
['Acme\bar', 'Humbug\Acme\bar'],
['Acme\foo', 'Humbug\Acme\foo'],
['Emca\baz', 'Humbug\Emca\baz'],
['Acme\Emca\foo', 'Humbug\Acme\Emca\foo'],
],
),
[],
Expand Down Expand Up @@ -218,6 +219,10 @@ public static function provideRegistry(): iterable

// Function aliases. For more information see:
// https://github.com/humbug/php-scoper/blob/master/docs/further-reading.md#function-aliases
namespace Acme\Emca {
if (!function_exists('Acme\Emca\foo')) { function foo() { return \Humbug\Acme\Emca\foo(...func_get_args()); } }
}

namespace Acme {
if (!function_exists('Acme\bar')) { function bar() { return \Humbug\Acme\bar(...func_get_args()); } }
if (!function_exists('Acme\foo')) { function foo() { return \Humbug\Acme\foo(...func_get_args()); } }
Expand Down
Loading