Skip to content

Pipeline

  • Full name: \Codefy\Framework\Pipeline\Pipeline
  • This class is marked as final and can't be subclassed
  • This class implements: \Codefy\Framework\Pipeline\Chainable
  • This class is a Final class

Properties

passable

The object being passed through the pipeline.

protected mixed $passable

onFailure

The callback to be executed on failure pipeline.

protected \Closure|null $onFailure

pipes

The array of class pipes.

protected array $pipes

method

The method to call on each pipe.

protected string $method

finally

The final callback to be executed after the pipeline ends regardless of the outcome.

protected \Closure|null $finally

container

protected \Qubus\Injector\ServiceContainer $container

Methods

__construct

public __construct(\Qubus\Injector\ServiceContainer $container): mixed

Parameters:

Parameter Type Description
$container \Qubus\Injector\ServiceContainer

send

Set the object being sent through the pipeline.

public send(mixed $passable): self

Parameters:

Parameter Type Description
$passable mixed

through

Set the array of pipes.

public through(mixed $pipes): self

Parameters:

Parameter Type Description
$pipes mixed

pipe

Push additional pipes onto the pipeline.

public pipe(callable $pipe): self

Parameters:

Parameter Type Description
$pipe callable

via

Set the method to call on the pipes.

public via(string $method): self

Parameters:

Parameter Type Description
$method string

then

Run the pipeline with a final destination callback.

public then(\Closure $destination): mixed

Parameters:

Parameter Type Description
$destination \Closure

Throws:


thenReturn

Run the pipeline and return the result.

public thenReturn(): mixed

Throws:


finally

Set a final callback to be executed after the pipeline ends regardless of the outcome.

public finally(\Closure $callback): self

Parameters:

Parameter Type Description
$callback \Closure

prepareDestination

Get the final piece of the Closure onion.

protected prepareDestination(\Closure $destination): \Closure

Parameters:

Parameter Type Description
$destination \Closure

carry

Get a Closure that represents a slice of the application onion.

protected carry(): \Closure

getContainer

Get the container instance.

protected getContainer(): \Qubus\Injector\ServiceContainer|null

onFailure

Set callback to be executed on failure pipeline.

public onFailure(\Closure $callback): self

Parameters:

Parameter Type Description
$callback \Closure

run

Run a single pipe.

public run(string $pipe, mixed $data = true): mixed

Parameters:

Parameter Type Description
$pipe string
$data mixed

parsePipeString

Parse full pipe string to get name and parameters.

protected parsePipeString(string $pipe): array

Parameters:

Parameter Type Description
$pipe string

pipes

Get the array of configured pipes.

protected pipes(): array

handleCarry

Handle the value returned from each pipe before passing it to the next.

protected handleCarry(mixed $carry): mixed

Parameters:

Parameter Type Description
$carry mixed

handleException

Handle the given exception.

protected handleException(mixed $passable, \Throwable $e): mixed

Parameters:

Parameter Type Description
$passable mixed
$e \Throwable

Throws:


Inherited methods

withTransaction

Enable transaction in pipeline.

public withTransaction(): static

beginTransaction

Begin the transaction if enabled.

protected beginTransaction(): void

Throws:


commitTransaction

Commit the transaction if enabled.

protected commitTransaction(): void

Throws:


rollbackTransaction

Rollback the transaction if enabled.

protected rollbackTransaction(): void

Throws:



Automatically generated on 2025-10-13