RouteSorter
Pre-processing of given routes based on their actual disposal concerning given parameters.
as this is tightly coupled to Symfony's Routing and we try to encapsulate this, please note that this might change
Table of Contents
Constants
Properties
- $originalParameters : array<string, string>
- $routes : array<string|int, Route>
Methods
- getRoutes() : array<string|int, Route>
- sortRoutesForGeneration() : self
- withOriginalParameters() : self
- withRoutes() : self
- compareAllVariablesPresence() : int|null
- compareDefaultRoutes() : int|null
- compareDefaultsAmount() : int|null
- compareForGeneration() : int
- compareMandatoryVariablesPresence() : int|null
- compareMissingDefaultsAmount() : int|null
- compareStaticRoutes() : int|null
- getActualRouteDefaults() : array<string, string>
- Filters route variable defaults that are actually used in route path.
- getAllRouteVariables() : array<string, int>
- getMandatoryRouteVariables() : array<string, int>
- getRouteParameters() : array<string, string>
Constants
EARLIER
protected
mixed
EARLIER
= -1
LATER
protected
mixed
LATER
= 1
Properties
$originalParameters
protected
array<string, string>
$originalParameters
= []
$routes
protected
array<string|int, Route>
$routes
= []
Methods
getRoutes()
public
getRoutes() : array<string|int, Route>
Return values
array<string|int, Route>sortRoutesForGeneration()
public
sortRoutesForGeneration() : self
Return values
selfwithOriginalParameters()
public
withOriginalParameters(array<string|int, mixed> $originalParameters) : self
Parameters
- $originalParameters : array<string|int, mixed>
Return values
selfwithRoutes()
public
withRoutes(array<string|int, mixed> $routes) : self
Parameters
- $routes : array<string|int, mixed>
Return values
selfcompareAllVariablesPresence()
protected
compareAllVariablesPresence(Route $self, Route $other[, int $action = self::EARLIER ]) : int|null
Parameters
Return values
int|nullcompareDefaultRoutes()
protected
compareDefaultRoutes(Route $self, Route $other[, int $action = self::LATER ]) : int|null
Parameters
Return values
int|nullcompareDefaultsAmount()
protected
compareDefaultsAmount(Route $self, Route $other[, int $action = self::LATER ]) : int|null
Parameters
Return values
int|nullcompareForGeneration()
protected
compareForGeneration(Route $self, Route $other) : int
Parameters
Return values
intcompareMandatoryVariablesPresence()
protected
compareMandatoryVariablesPresence(Route $self, Route $other[, int $action = self::EARLIER ]) : int|null
Parameters
Return values
int|nullcompareMissingDefaultsAmount()
protected
compareMissingDefaultsAmount(Route $self, Route $other[, int $action = self::LATER ]) : int|null
Parameters
Return values
int|nullcompareStaticRoutes()
protected
compareStaticRoutes(Route $self, Route $other[, int $action = self::LATER ]) : int|null
Parameters
Return values
int|nullgetActualRouteDefaults()
Filters route variable defaults that are actually used in route path.
protected
getActualRouteDefaults(Route $route) : array<string, string>
Parameters
- $route : Route
Return values
array<string, string>getAllRouteVariables()
protected
getAllRouteVariables(Route $route) : array<string, int>
Parameters
- $route : Route
Return values
array<string, int>getMandatoryRouteVariables()
protected
getMandatoryRouteVariables(Route $route) : array<string, int>
Parameters
- $route : Route
Return values
array<string, int>getRouteParameters()
protected
getRouteParameters(Route $route) : array<string, string>
Parameters
- $route : Route