RouteSorter

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

EARLIER  = -1
LATER  = 1

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

Properties

$originalParameters

protected array<string, string> $originalParameters = []

Methods

getRoutes()

public getRoutes() : array<string|int, Route>
Return values
array<string|int, Route>

sortRoutesForGeneration()

public sortRoutesForGeneration() : self
Return values
self

withOriginalParameters()

public withOriginalParameters(array<string|int, mixed> $originalParameters) : self
Parameters
$originalParameters : array<string|int, mixed>
Return values
self

withRoutes()

public withRoutes(array<string|int, mixed> $routes) : self
Parameters
$routes : array<string|int, mixed>
Return values
self

compareAllVariablesPresence()

protected compareAllVariablesPresence(Route $self, Route $other[, int $action = self::EARLIER ]) : int|null
Parameters
$self : Route
$other : Route
$action : int = self::EARLIER
Return values
int|null

compareDefaultRoutes()

protected compareDefaultRoutes(Route $self, Route $other[, int $action = self::LATER ]) : int|null
Parameters
$self : Route
$other : Route
$action : int = self::LATER
Return values
int|null

compareDefaultsAmount()

protected compareDefaultsAmount(Route $self, Route $other[, int $action = self::LATER ]) : int|null
Parameters
$self : Route
$other : Route
$action : int = self::LATER
Return values
int|null

compareForGeneration()

protected compareForGeneration(Route $self, Route $other) : int
Parameters
$self : Route
$other : Route
Return values
int

compareMandatoryVariablesPresence()

protected compareMandatoryVariablesPresence(Route $self, Route $other[, int $action = self::EARLIER ]) : int|null
Parameters
$self : Route
$other : Route
$action : int = self::EARLIER
Return values
int|null

compareMissingDefaultsAmount()

protected compareMissingDefaultsAmount(Route $self, Route $other[, int $action = self::LATER ]) : int|null
Parameters
$self : Route
$other : Route
$action : int = self::LATER
Return values
int|null

compareStaticRoutes()

protected compareStaticRoutes(Route $self, Route $other[, int $action = self::LATER ]) : int|null
Parameters
$self : Route
$other : Route
$action : int = self::LATER
Return values
int|null

getActualRouteDefaults()

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
Return values
array<string, string>

        
On this page

Search results