Skip to content

Commit a56bfce

Browse files
authored
Fixed phpstan (#7290)
* Fixed phpstan * Update Collection.php
1 parent 9ec6c15 commit a56bfce

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

src/Collection.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,11 @@ public function mode($key = null)
121121

122122
/**
123123
* @template TValue of array-key
124-
* @phpstan-ignore-next-line
125124
* @var static<TValue, int> $counts
126125
*/
127126
$counts = new self();
128127
$collection->each(function ($value) use ($counts) {
129-
$counts[$value] = isset($counts[$value]) ? $counts[$value] + 1 : 1;
128+
$counts->offsetSet($value, isset($counts[$value]) ? $counts[$value] + 1 : 1);
130129
});
131130
$sorted = $counts->sort();
132131
$highestValue = $sorted->last();

0 commit comments

Comments
 (0)