Skip to content

Commit

Permalink
fix method doctypes of Arr Support class
Browse files Browse the repository at this point in the history
  • Loading branch information
hAz5 committed Mar 15, 2022
1 parent bf4496e commit 4d015aa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
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);

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

public function testShuffleWithSeed()
Expand Down

0 comments on commit 4d015aa

Please sign in to comment.