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

[9.x] Fix method doctypes of Arr class #41488

Merged
merged 1 commit into from Mar 15, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Illuminate/Collections/Arr.php
Expand Up @@ -25,7 +25,7 @@ public static function accessible($value)
* Add an element to an array using "dot" notation if it doesn't exist.
*
* @param array $array
* @param string $key
* @param string|int|float $key
* @param mixed $value
* @return array
*/
Expand Down Expand Up @@ -599,7 +599,7 @@ public static function random($array, $number = null, $preserveKeys = false)
* If no key is given to the method, the entire array will be replaced.
*
* @param array $array
* @param string|null $key
* @param string|int|null $key
* @param mixed $value
* @return array
*/
Expand Down
5 changes: 5 additions & 0 deletions tests/Support/SupportArrTest.php
Expand Up @@ -32,6 +32,8 @@ public function testAdd()

$this->assertEquals(['surname' => 'Mövsümov'], Arr::add([], 'surname', 'Mövsümov'));
$this->assertEquals(['developer' => ['name' => 'Ferid']], Arr::add([], 'developer.name', 'Ferid'));
$this->assertEquals([1 => 'hAz'], Arr::add([], 1, 'hAz'));
$this->assertEquals([1 => [1 => 'hAz']], Arr::add([], 1.1, 'hAz'));
}

public function testCollapse()
Expand Down Expand Up @@ -760,6 +762,9 @@ public function testSet()
$array = ['products' => 'table'];
Arr::set($array, 'products.desk.price', 300);
$this->assertSame(['products' => ['desk' => ['price' => 300]]], $array);
hAz5 marked this conversation as resolved.
Show resolved Hide resolved

$array = [1 => 'test'];
$this->assertEquals([1 => 'hAz'], Arr::set($array, 1, 'hAz'));
}

public function testShuffleWithSeed()
Expand Down