Skip to content

Commit 1854df9

Browse files
committed
fix conflicts
2 parents b155ee2 + a4afcfa commit 1854df9

File tree

3 files changed

+30
-1
lines changed

3 files changed

+30
-1
lines changed

Collection.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ public function implode($value, $glue = null)
512512
{
513513
$first = $this->first();
514514

515-
if (is_array($first) || is_object($first)) {
515+
if (is_array($first) || (is_object($first) && ! $first instanceof Stringable)) {
516516
return implode($glue, $this->pluck($value)->all());
517517
}
518518

LazyCollection.php

+26
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use ArrayIterator;
66
use Closure;
7+
use DateTimeInterface;
78
use Illuminate\Support\Traits\EnumeratesValues;
89
use Illuminate\Support\Traits\Macroable;
910
use IteratorAggregate;
@@ -1213,6 +1214,21 @@ public function takeUntil($value)
12131214
});
12141215
}
12151216

1217+
/**
1218+
* Take items in the collection until a given point in time.
1219+
*
1220+
* @param \DateTimeInterface $timeout
1221+
* @return static
1222+
*/
1223+
public function takeUntilTimeout(DateTimeInterface $timeout)
1224+
{
1225+
$timeout = $timeout->getTimestamp();
1226+
1227+
return $this->takeWhile(function () use ($timeout) {
1228+
return $this->now() < $timeout;
1229+
});
1230+
}
1231+
12161232
/**
12171233
* Take items in the collection while the given condition is met.
12181234
*
@@ -1385,4 +1401,14 @@ protected function passthru($method, array $params)
13851401
yield from $this->collect()->$method(...$params);
13861402
});
13871403
}
1404+
1405+
/**
1406+
* Get the current time.
1407+
*
1408+
* @return int
1409+
*/
1410+
protected function now()
1411+
{
1412+
return time();
1413+
}
13881414
}

composer.json

+3
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@
3131
"dev-master": "9.x-dev"
3232
}
3333
},
34+
"suggest": {
35+
"symfony/var-dumper": "Required to use the dump method (^5.1)."
36+
},
3437
"config": {
3538
"sort-packages": true
3639
},

0 commit comments

Comments
 (0)