RouteSorter
class \
Pre-processing of given routes based on their actual disposal concerning given parameters.
Internal
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 : Route[]
Methods
- getRoutes() : 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
Route[]
$routes
= []
Methods
getRoutes()
public
getRoutes() : Route[]
Return values
Route[]sortRoutesForGeneration()
public
sortRoutesForGeneration() : self
Return values
selfwithOriginalParameters()
public
withOriginalParameters(array $originalParameters) : self
Parameters
- $originalParameters : array
Return values
selfwithRoutes()
public
withRoutes(array $routes) : self
Parameters
- $routes : array
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