class RouteProcessorManager implements OutboundRouteProcessorInterface (View source)

Route processor manager.

Holds an array of route processor objects and uses them to sequentially process an outbound route, in order of processor priority.

Properties

protected array $outboundProcessors

Holds the array of outbound processors to cycle through.

protected array $sortedOutbound

Holds the array of outbound processors, sorted by priority.

Methods

addOutbound(OutboundRouteProcessorInterface $processor, int $priority = 0)

Adds an outbound processor object to the $outboundProcessors property.

The
processOutbound(string $route_name, Route $route, array $parameters, BubbleableMetadata $bubbleable_metadata = NULL)

Processes the outbound route.

array
getOutbound()

Returns the sorted array of outbound processors.

sortProcessors()

Sorts the processors according to priority.

Details

addOutbound(OutboundRouteProcessorInterface $processor, int $priority = 0)

Adds an outbound processor object to the $outboundProcessors property.

Parameters

OutboundRouteProcessorInterface $processor

The processor object to add.

int $priority

The priority of the processor being added.

The processOutbound(string $route_name, Route $route, array $parameters, BubbleableMetadata $bubbleable_metadata = NULL)

Processes the outbound route.

Parameters

string $route_name

The route name.

Route $route

The outbound route to process.

array $parameters

An array of parameters to be passed to the route compiler. Passed by reference.

BubbleableMetadata $bubbleable_metadata

(optional) Object to collect route processors' bubbleable metadata.

Return Value

The

processed path.

protected array getOutbound()

Returns the sorted array of outbound processors.

Return Value

array

An array of processor objects.

protected sortProcessors()

Sorts the processors according to priority.