Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Illuminate/Filesystem/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
* Join the given paths together.
*
* @param string|null $basePath
* @param string ...$paths
* @param string|null ...$paths
* @return string
*/
function join_paths($basePath, string ...$paths)
function join_paths($basePath, ?string ...$paths)
{
foreach ($paths as $index => $path) {
if (empty($path)) {
Expand Down
2 changes: 2 additions & 0 deletions tests/Filesystem/JoinPathsHelperTest.php
Original file line number Diff line number Diff line change
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')];
}

#[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')];
}
}