Skip to content

Commit 7f939e1

Browse files
committed
Editing compare stream method
1 parent 9acf05d commit 7f939e1

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/WS/Utils/Collections/SerialStream.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ public function max(callable $comparator)
248248
}
249249

250250
$array = $collection->toArray();
251-
$el = array_unshift($array);
251+
$el = null;
252252

253253
foreach ($array as $item) {
254254
if ($comparator($item, $el) > 0) {

tests/WS/Utils/Collections/SerialStreamTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -293,11 +293,11 @@ public function findAnyElementChecking($input): void
293293
public function sortDataSet(): array
294294
{
295295
return [
296-
// input | comparator | min| max | sorted
297-
[[1, 2, 3, 4], self::fIntComparator(), 1, 4, [1, 2, 3, 4]],
298-
[[3, 12, 1, 4], self::fIntComparator(), 1, 12, [1, 3, 4, 12]],
299-
[[], self::fIntComparator(), null, null, []],
300-
[[1], self::fIntComparator(), 1, 1, [1]],
296+
// input | comparator | min | max | sorted
297+
[[1, 2, 3, 4], self::fIntComparator(), 1, 4, [1, 2, 3, 4]],
298+
[[3, 12, 1, 4], self::fIntComparator(), 1, 12, [1, 3, 4, 12]],
299+
[[], self::fIntComparator(), null, null, []],
300+
[[1], self::fIntComparator(), 1, 1, [1]],
301301
];
302302
}
303303

0 commit comments

Comments
 (0)