class PendingChainFake extends PendingChain (View source)

Traits

Properties

mixed $job

The class name of the job being dispatched.

from  PendingChain
array $chain

The jobs to be chained.

from  PendingChain
string|null $connection

The name of the connection the chain should be sent to.

from  PendingChain
string|null $queue

The name of the queue the chain should be sent to.

from  PendingChain
DateTimeInterface|DateInterval|int|null $delay

The number of seconds before the chain should be made available.

from  PendingChain
array $catchCallbacks

The callbacks to be executed on failure.

from  PendingChain
protected BusFake $bus

The fake bus instance.

Methods

$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.

void
__construct(BusFake $bus, mixed $job, array $chain)

Create a new pending chain instance.

$this
onConnection(string|null $connection)

Set the desired connection for the job.

$this
onQueue(BackedEnum|string|null $queue)

Set the desired queue for the job.

$this
delay(DateTimeInterface|DateInterval|int|null $delay)

Set the desired delay in seconds for the chain.

$this
catch(callable $callback)

Add a callback to be executed on job failure.

array
catchCallbacks()

Get the "catch" callbacks that have been registered.

dispatch()

Dispatch the job with the given arguments.

dispatchIf(bool|Closure $boolean)

Dispatch the job chain if the given truth test passes.

dispatchUnless(bool|Closure $boolean)

Dispatch the job chain unless the given truth test passes.

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.

Parameters

$value
callable|null $callback
callable|null $default

Return Value

$this|TWhenReturnType

$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.

Parameters

$value
callable|null $callback
callable|null $default

Return Value

$this|TUnlessReturnType

void __construct(BusFake $bus, mixed $job, array $chain)

Create a new pending chain instance.

Parameters

BusFake $bus
mixed $job
array $chain

Return Value

void

$this onConnection(string|null $connection)

Set the desired connection for the job.

Parameters

string|null $connection

Return Value

$this

$this onQueue(BackedEnum|string|null $queue)

Set the desired queue for the job.

Parameters

BackedEnum|string|null $queue

Return Value

$this

$this delay(DateTimeInterface|DateInterval|int|null $delay)

Set the desired delay in seconds for the chain.

Parameters

DateTimeInterface|DateInterval|int|null $delay

Return Value

$this

$this catch(callable $callback)

Add a callback to be executed on job failure.

Parameters

callable $callback

Return Value

$this

array catchCallbacks()

Get the "catch" callbacks that have been registered.

Return Value

array

PendingDispatch dispatch()

Dispatch the job with the given arguments.

Return Value

PendingDispatch

PendingDispatch|null dispatchIf(bool|Closure $boolean)

Dispatch the job chain if the given truth test passes.

Parameters

bool|Closure $boolean

Return Value

PendingDispatch|null

PendingDispatch|null dispatchUnless(bool|Closure $boolean)

Dispatch the job chain unless the given truth test passes.

Parameters

bool|Closure $boolean

Return Value

PendingDispatch|null