abstract class AbstractRouteCollection implements Countable, IteratorAggregate, RouteCollectionInterface (View source)

Methods

handleMatchedRoute(Request $request, Route|null $route)

Handle the matched route.

array
checkForAlternateVerbs(Request $request)

Determine if any routes match on another HTTP verb.

Route|null
matchAgainstRoutes(array $routes, Request $request, bool $includingMethod = true)

Determine if a route in the array matches the request.

getRouteForMethods(Request $request, array $methods)

Get a route (if necessary) that responds when other available methods are present.

void
methodNotAllowed(array $others, string $method)

Throw a method not allowed HTTP exception.

array
compile()

Compile the routes for caching.

CompiledUrlMatcherDumper
dumper()

Return the CompiledUrlMatcherDumper instance for the route collection.

RouteCollection
toSymfonyRouteCollection()

Convert the collection to a Symfony RouteCollection instance.

RouteCollection
addToSymfonyRoutesCollection(RouteCollection $symfonyRoutes, Route $route)

Add a route to the SymfonyRouteCollection instance.

string
generateRouteName()

Get a randomly generated route name.

getIterator()

Get an iterator for the items.

int
count()

Count the number of items in the collection.

Details

protected Route handleMatchedRoute(Request $request, Route|null $route)

Handle the matched route.

Parameters

Request $request
Route|null $route

Return Value

Route

Exceptions

NotFoundHttpException

protected array checkForAlternateVerbs(Request $request)

Determine if any routes match on another HTTP verb.

Parameters

Request $request

Return Value

array

protected Route|null matchAgainstRoutes(array $routes, Request $request, bool $includingMethod = true)

Determine if a route in the array matches the request.

Parameters

array $routes
Request $request
bool $includingMethod

Return Value

Route|null

protected Route getRouteForMethods(Request $request, array $methods)

Get a route (if necessary) that responds when other available methods are present.

Parameters

Request $request
array $methods

Return Value

Route

Exceptions

MethodNotAllowedHttpException

protected void methodNotAllowed(array $others, string $method)

Throw a method not allowed HTTP exception.

Parameters

array $others
string $method

Return Value

void

Exceptions

MethodNotAllowedHttpException

array compile()

Compile the routes for caching.

Return Value

array

CompiledUrlMatcherDumper dumper()

Return the CompiledUrlMatcherDumper instance for the route collection.

Return Value

CompiledUrlMatcherDumper

RouteCollection toSymfonyRouteCollection()

Convert the collection to a Symfony RouteCollection instance.

Return Value

RouteCollection

protected RouteCollection addToSymfonyRoutesCollection(RouteCollection $symfonyRoutes, Route $route)

Add a route to the SymfonyRouteCollection instance.

Parameters

RouteCollection $symfonyRoutes
Route $route

Return Value

RouteCollection

protected string generateRouteName()

Get a randomly generated route name.

Return Value

string

ArrayIterator getIterator()

Get an iterator for the items.

Return Value

ArrayIterator

int count()

Count the number of items in the collection.

Return Value

int