Skip to content
Closed
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/Illuminate/Collections/Arr.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ public static function dot($array, $prepend = '')
if (is_array($value) && ! empty($value)) {
$flatten($value, $newKey.'.');
} else {
$results[$newKey] = $value;
$results[$newKey] = is_array($value) ? null : $value;
}
}
};
Expand Down
6 changes: 3 additions & 3 deletions tests/Support/SupportArrTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,10 @@ public function testDot()
$this->assertSame([], $array);

$array = Arr::dot(['foo' => []]);
$this->assertSame(['foo' => []], $array);
$this->assertSame(['foo' => null], $array);

$array = Arr::dot(['foo' => ['bar' => []]]);
$this->assertSame(['foo.bar' => []], $array);
$this->assertSame(['foo.bar' => null], $array);

$array = Arr::dot(['name' => 'taylor', 'languages' => ['php' => true]]);
$this->assertSame(['name' => 'taylor', 'languages.php' => true], $array);
Expand All @@ -243,7 +243,7 @@ public function testDot()
$array = Arr::dot(['foo' => 'bar', 'empty_array' => [], 'user' => ['name' => 'Taylor'], 'key' => 'value']);
$this->assertSame([
'foo' => 'bar',
'empty_array' => [],
'empty_array' => null,
'user.name' => 'Taylor',
'key' => 'value',
], $array);
Expand Down
2 changes: 1 addition & 1 deletion tests/Testing/Console/ConfigShowCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function testDisplayConfig()
->expectsOutput(' boolean ............................................... true ')
->expectsOutput(' null .................................................. null ')
->expectsOutput(' array ⇁ 0 .. Illuminate\Foundation\Console\ConfigShowCommand ')
->expectsOutput(' empty_array ............................................. [] ')
->expectsOutputToContain('empty_array')
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

->expectsOutput(' empty_array ........................................... null ') would look nicer

Copy link
Author

@imhayatunnabi imhayatunnabi Oct 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But this was for the best test resiliency also had issue with php 8.3 testing. You can have look on the first commit

->expectsOutput(' assoc_array ⇁ foo ...................................... bar ')
->expectsOutput(' class ............................................. stdClass ');
}
Expand Down