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

[10.x] Illuminate\Filesystem\join_paths(): Argument #2 must be of type string, null given #49467

Merged
merged 5 commits into from Dec 21, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Illuminate/Filesystem/functions.php
Expand Up @@ -7,10 +7,10 @@
* Join the given paths together.
*
* @param string|null $basePath
* @param string ...$paths
* @param string|null ...$paths
tylernathanreed marked this conversation as resolved.
Show resolved Hide resolved
* @return string
*/
function join_paths($basePath, string ...$paths)
function join_paths($basePath, ?string ...$paths)
tylernathanreed marked this conversation as resolved.
Show resolved Hide resolved
{
foreach ($paths as $index => $path) {
if (empty($path)) {
Expand Down
2 changes: 2 additions & 0 deletions tests/Filesystem/JoinPathsHelperTest.php
Expand Up @@ -21,6 +21,7 @@ public static function unixDataProvider()
{
yield ['app/Http/Kernel.php', join_paths('app', 'Http', 'Kernel.php')];
yield ['app/Http/Kernel.php', join_paths('app', '', 'Http', 'Kernel.php')];
yield ['app/Http/Kernel.php', join_paths('app', null, 'Http', 'Kernel.php')];
crynobone marked this conversation as resolved.
Show resolved Hide resolved
}

#[RequiresOperatingSystem('Windows')]
Expand All @@ -34,5 +35,6 @@ public static function windowsDataProvider()
{
yield ['app\Http\Kernel.php', join_paths('app', 'Http', 'Kernel.php')];
yield ['app\Http\Kernel.php', join_paths('app', '', 'Http', 'Kernel.php')];
yield ['app\Http\Kernel.php', join_paths('app', null, 'Http', 'Kernel.php')];
tylernathanreed marked this conversation as resolved.
Show resolved Hide resolved
}
}