StepResult
class StepResult implements IteratorAggregate
Properties
| protected StepResponse): void> | $callbacks | ||
| protected StepResponse|null | $response | ||
| protected bool | $resolved | ||
| protected StreamEvent[] | $buffered |
Methods
Create a buffered or streamed step result.
Create a result that ends the run before the model is called.
Iterate the stream to its end or call response(); a partial iteration cannot be resumed.
Determine whether the step response is backed by a stream.
Determine whether middleware stopped the run instead of taking the step.
Get the step's response, or null when a stream ended without one.
Resolve the step response and invoke registered callbacks.
Details
at line 34
__construct(Generator|StepResponse|null $source, PendingStep|null $step = null, StepContext|null $context = null, int|null $startedAt = null)
Create a buffered or streamed step result.
at line 45
static StepResult
stop()
Create a result that ends the run before the model is called.
at line 55
StepResult
then(Closure $callback)
Register a callback to run once the step's response is available.
at line 71
Generator
getIterator()
Iterate the stream to its end or call response(); a partial iteration cannot be resumed.
at line 101
bool
streamed()
Determine whether the step response is backed by a stream.
at line 109
bool
stopped()
Determine whether middleware stopped the run instead of taking the step.
at line 117
StepResponse|null
response()
Get the step's response, or null when a stream ended without one.
at line 129
protected void
resolve(mixed $response)
Resolve the step response and invoke registered callbacks.