PendingBatchFake
class PendingBatchFake extends PendingBatch
Traits
Properties
| string | $name | The batch name. |
from PendingBatch |
| array | $options | The batch options. |
from PendingBatch |
| static protected array<class-string, bool> | $batchableClasses | Jobs that have been verified to contain the Batchable trait. |
from PendingBatch |
Methods
Apply the callback if the given "value" is (or resolves to) truthy.
Apply the callback if the given "value" is (or resolves to) falsy.
Add a callback to be executed when the batch is stored.
Get the "before" callbacks that have been registered with the pending batch.
Add a callback to be executed after a job in the batch have executed successfully.
Get the "progress" callbacks that have been registered with the pending batch.
Add a callback to be executed after all jobs in the batch have executed successfully.
Get the "then" callbacks that have been registered with the pending batch.
Add a callback to be executed after the first failing job in the batch.
Get the "catch" callbacks that have been registered with the pending batch.
Add a callback to be executed after the batch has finished executing.
Get the "finally" callbacks that have been registered with the pending batch.
Indicate that the batch should not be canceled when a job within the batch fails.
Determine if the pending batch allows jobs to fail without cancelling the batch.
Get the "failure" callbacks that have been registered with the pending batch.
Specify the queue connection that the batched jobs should run on.
Specify the queue that the batched jobs should run on.
Dispatch batched jobs through the transactional outbox by default.
Dispatch batched jobs without the transactional outbox by default.
Stage batched jobs on the given database connection by default.
Add additional data into the batch's options array.
Dispatch the batch after the response is sent to the browser.
Get the class name of the first parameter of the given Closure.
Get the class names of the first parameter of the given Closure, including union types.
Get the class names / types of the parameters of the given Closure.
Get the class names / types of the return type of the given Closure.
Determine if the jobs in the batch match the given jobs.
Details
in
Conditionable at line 23
mixed
when(mixed $value = null, callable|null $callback = null, callable|null $default = null)
Apply the callback if the given "value" is (or resolves to) truthy.
in
Conditionable at line 56
mixed
unless(mixed $value = null, callable|null $callback = null, callable|null $default = null)
Apply the callback if the given "value" is (or resolves to) falsy.
at line 22
__construct(BusFake $bus, Collection $jobs)
Create a new pending batch instance.
in
PendingBatch at line 62
PendingBatch
add(iterable|object $jobs)
Add jobs to the batch.
in
PendingBatch at line 80
protected void
ensureJobIsBatchable(object|array $job)
Ensure the given job is batchable.
in
PendingBatch at line 102
PendingBatch
before(callable $callback)
Add a callback to be executed when the batch is stored.
in
PendingBatch at line 112
array
beforeCallbacks()
Get the "before" callbacks that have been registered with the pending batch.
in
PendingBatch at line 122
PendingBatch
progress(callable $callback)
Add a callback to be executed after a job in the batch have executed successfully.
in
PendingBatch at line 132
array
progressCallbacks()
Get the "progress" callbacks that have been registered with the pending batch.
in
PendingBatch at line 142
PendingBatch
then(callable $callback)
Add a callback to be executed after all jobs in the batch have executed successfully.
in
PendingBatch at line 152
array
thenCallbacks()
Get the "then" callbacks that have been registered with the pending batch.
in
PendingBatch at line 162
PendingBatch
catch(callable $callback)
Add a callback to be executed after the first failing job in the batch.
in
PendingBatch at line 172
array
catchCallbacks()
Get the "catch" callbacks that have been registered with the pending batch.
in
PendingBatch at line 182
PendingBatch
finally(callable $callback)
Add a callback to be executed after the batch has finished executing.
in
PendingBatch at line 192
array
finallyCallbacks()
Get the "finally" callbacks that have been registered with the pending batch.
in
PendingBatch at line 205
PendingBatch
allowFailures(mixed $param = true)
Indicate that the batch should not be canceled when a job within the batch fails.
Optionally, add callbacks to be executed upon each job failure.
in
PendingBatch at line 225
bool
allowsFailures()
Determine if the pending batch allows jobs to fail without cancelling the batch.
in
PendingBatch at line 235
array
failureCallbacks()
Get the "failure" callbacks that have been registered with the pending batch.
in
PendingBatch at line 255
PendingBatch
name(string $name)
Set the name for the batch.
in
PendingBatch at line 267
PendingBatch
onConnection(UnitEnum|string $connection)
Specify the queue connection that the batched jobs should run on.
in
PendingBatch at line 279
string|null
connection()
Get the connection used by the pending batch.
in
PendingBatch at line 289
PendingBatch
onQueue(UnitEnum|string|null $queue)
Specify the queue that the batched jobs should run on.
in
PendingBatch at line 301
string|null
queue()
Get the queue used by the pending batch.
in
PendingBatch at line 311
PendingBatch
viaOutbox()
Dispatch batched jobs through the transactional outbox by default.
in
PendingBatch at line 323
PendingBatch
withoutOutbox()
Dispatch batched jobs without the transactional outbox by default.
in
PendingBatch at line 337
PendingBatch
onOutboxDatabase(UnitEnum|string $connection)
Stage batched jobs on the given database connection by default.
in
PendingBatch at line 356
PendingBatch
withOption(string $key, mixed $value)
Add additional data into the batch's options array.
at line 32
Batch
dispatch()
Dispatch the batch.
at line 40
Batch
dispatchAfterResponse()
Dispatch the batch after the response is sent to the browser.
in
PendingBatch at line 415
protected void
dispatchExistingBatch(Batch $batch)
Dispatch an existing batch.
in
PendingBatch at line 438
Batch|null
dispatchIf(bool|Closure $boolean)
Dispatch the batch if the given truth test passes.
in
PendingBatch at line 446
Batch|null
dispatchUnless(bool|Closure $boolean)
Dispatch the batch unless the given truth test passes.
in
PendingBatch at line 454
protected Batch
store(BatchRepository $repository)
Store the batch using the given repository.
in
PendingBatch at line 487
static void
flushState()
Flush all static state.
in
ReflectsClosures at line 26
protected string
firstClosureParameterType(Closure $closure)
Get the class name of the first parameter of the given Closure.
in
ReflectsClosures at line 49
protected array
firstClosureParameterTypes(Closure $closure)
Get the class names of the first parameter of the given Closure, including union types.
in
ReflectsClosures at line 75
protected array
closureParameterTypes(Closure $closure)
Get the class names / types of the parameters of the given Closure.
in
ReflectsClosures at line 97
protected array
closureReturnTypes(Closure $closure)
Get the class names / types of the return type of the given Closure.
at line 48
bool
hasJobs(array $expectedJobs)
Determine if the jobs in the batch match the given jobs.