Skip to content

Commit

Permalink
Merge pull request #44865 from Josh-G/patch-1
Browse files Browse the repository at this point in the history
Fix Collection::combine return docblock
  • Loading branch information
nunomaduro authored Nov 7, 2022
2 parents 033b956 + 11a7ea9 commit f14b34b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Illuminate/Collections/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,7 @@ public function mergeRecursive($items)
* @template TCombineValue
*
* @param \Illuminate\Contracts\Support\Arrayable<array-key, TCombineValue>|iterable<array-key, TCombineValue> $values
* @return static<TKey, TCombineValue>
* @return static<TValue, TCombineValue>
*/
public function combine($values)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Collections/Enumerable.php
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,7 @@ public function mergeRecursive($items);
* @template TCombineValue
*
* @param \Illuminate\Contracts\Support\Arrayable<array-key, TCombineValue>|iterable<array-key, TCombineValue> $values
* @return static<TKey, TCombineValue>
* @return static<TValue, TCombineValue>
*/
public function combine($values);

Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Collections/LazyCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,7 @@ public function mergeRecursive($items)
* @template TCombineValue
*
* @param \IteratorAggregate<array-key, TCombineValue>|array<array-key, TCombineValue>|(callable(): \Generator<array-key, TCombineValue>) $values
* @return static<TKey, TCombineValue>
* @return static<TValue, TCombineValue>
*/
public function combine($values)
{
Expand Down
1 change: 1 addition & 0 deletions types/Support/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,7 @@ function ($collection, $count) {

assertType('Illuminate\Support\Collection<string, int>', $collection->make(['string' => 'string'])->combine([2]));
assertType('Illuminate\Support\Collection<int, int>', $collection->make([1])->combine([1]));
assertType('Illuminate\Support\Collection<string, string>', $collection->make(['string'])->combine(['string']));

assertType('Illuminate\Support\Collection<int, int>', $collection->make([1])->union([1]));
assertType('Illuminate\Support\Collection<string, string>', $collection->make(['string' => 'string'])->union(['string' => 'string']));
Expand Down

0 comments on commit f14b34b

Please sign in to comment.