Allow PHP-8.2 and up Compatibility instead of just PHP-8.4

This commit is contained in:
johnnyq
2026-06-12 17:06:10 -04:00
parent 2204bd52f4
commit d3a93652f3
220 changed files with 7198 additions and 2635 deletions

View File

@@ -137,7 +137,6 @@ class BusFake implements Fake, QueueingDispatcher
* Assert if a job was pushed exactly once.
*
* @param string|\Closure $command
* @param int $times
* @return void
*/
public function assertDispatchedOnce($command)
@@ -488,7 +487,7 @@ class BusFake implements Fake, QueueingDispatcher
/**
* Create a new assertion about a chained batch.
*
* @param \Closure $callback
* @param \Closure(\Illuminate\Bus\PendingBatch): bool $callback
* @return \Illuminate\Support\Testing\Fakes\ChainedBatchTruthTest
*/
public function chainedBatch(Closure $callback)
@@ -499,11 +498,13 @@ class BusFake implements Fake, QueueingDispatcher
/**
* Assert if a batch was dispatched based on a truth-test callback.
*
* @param callable $callback
* @param array|callable(\Illuminate\Bus\PendingBatch): bool $callback
* @return void
*/
public function assertBatched(callable $callback)
public function assertBatched(callable|array $callback)
{
$callback = is_array($callback) ? fn (PendingBatchFake $batch) => $batch->hasJobs($callback) : $callback;
PHPUnit::assertTrue(
$this->batched($callback)->count() > 0,
'The expected batch was not dispatched.'
@@ -606,8 +607,8 @@ class BusFake implements Fake, QueueingDispatcher
/**
* Get all of the pending batches matching a truth-test callback.
*
* @param callable $callback
* @return \Illuminate\Support\Collection
* @param callable(\Illuminate\Bus\PendingBatch): bool $callback
* @return \Illuminate\Support\Collection<int, \Illuminate\Bus\PendingBatch>
*/
public function batched(callable $callback)
{