Skip to content
Closed
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
3 changes: 3 additions & 0 deletions src/Illuminate/Collections/Arr.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ public static function add($array, $key, $value)
/**
* Get an array item from an array using "dot" notation.
*
* @param \ArrayAccess|array $array
* @param string|int|null $key
* @param array|null $default
* @return array
Comment on lines +67 to 70
Copy link
Contributor

Choose a reason for hiding this comment

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

You could improve this a bit:

Suggested change
* @param \ArrayAccess|array $array
* @param string|int|null $key
* @param array|null $default
* @return array
* @template TKey of string|int
*
* @param \ArrayAccess|array<TKey, array> $array
* @param TKey|null $key
* @param array|null $default
* @return array

making the array generic as well probably doesn't help here:

Suggested change
* @param \ArrayAccess|array $array
* @param string|int|null $key
* @param array|null $default
* @return array
* @template TKey of string|int
* @template TReturn of array
*
* @param \ArrayAccess|array<TKey, TReturn> $array
* @param TKey|null $key
* @param TReturn|null $default
* @return TReturn

Copy link
Contributor

@shaedrich shaedrich Oct 21, 2025

Choose a reason for hiding this comment

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

However, the way it is now, you merely duplicated the PHPDoc block. This wouldn't be very helpful on its own and would work against efforts like #57219 and #56775

Copy link
Author

Choose a reason for hiding this comment

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

You are right. Close my PR.

Thanks !

*
* @throws \InvalidArgumentException
Expand Down