PendingBatchFake
class PendingBatchFake extends PendingBatch (View source)
Traits
Properties
protected Container | $container | The IoC container instance. |
from PendingBatch |
string | $name | The batch name. |
from PendingBatch |
Collection | $jobs | The jobs that belong to the batch. |
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 |
protected BusFake | $bus | The fake bus instance. |
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 cancelled when a job within the batch fails.
Determine if the pending batch allows jobs to fail without cancelling the batch.
Specify the queue connection that the batched jobs should run on.
Specify the queue that the batched jobs should run on.
Add additional data into the batch's options array.
Dispatch the batch after the response is sent to the browser.
Details
$this|TWhenReturnType
when($value = null, callable|null $callback = null, callable|null $default = null)
Apply the callback if the given "value" is (or resolves to) truthy.
$this|TUnlessReturnType
unless($value = null, callable|null $callback = null, callable|null $default = null)
Apply the callback if the given "value" is (or resolves to) falsy.
array
beforeCallbacks()
Get the "before" callbacks that have been registered with the pending batch.
$this
progress(callable $callback)
Add a callback to be executed after a job in the batch have executed successfully.
array
progressCallbacks()
Get the "progress" callbacks that have been registered with the pending batch.
$this
then(callable $callback)
Add a callback to be executed after all jobs in the batch have executed successfully.
$this
catch(callable $callback)
Add a callback to be executed after the first failing job in the batch.
$this
finally(callable $callback)
Add a callback to be executed after the batch has finished executing.
array
finallyCallbacks()
Get the "finally" callbacks that have been registered with the pending batch.
$this
allowFailures(bool $allowFailures = true)
Indicate that the batch should not be cancelled when a job within the batch fails.
bool
allowsFailures()
Determine if the pending batch allows jobs to fail without cancelling the batch.
$this
onConnection(string $connection)
Specify the queue connection that the batched jobs should run on.
Batch|null
dispatchUnless(bool|Closure $boolean)
Dispatch the batch unless the given truth test passes.