AnnotatedRouteControllerLoader
extends AnnotationClassLoader
in package
AnnotatedRouteControllerLoader is an implementation of AnnotationClassLoader that sets the '_controller' default based on the class and method names.
Tags
Table of Contents
Properties
- $defaultRouteIndex : int
- $env : mixed
- $reader : mixed
- $routeAnnotationClass : string
Methods
- __construct() : mixed
- getResolver() : LoaderResolverInterface
- Gets the loader resolver.
- load() : mixed
- Loads from annotations from a class.
- setResolver() : mixed
- Sets the loader resolver.
- setRouteAnnotationClass() : mixed
- Sets the annotation class to read route properties from.
- supports() : bool
- Returns whether this class supports the given resource.
- addRoute() : mixed
- configureRoute() : mixed
- Configures the _controller default parameter of a given Route instance.
- createRoute() : mixed
- getDefaultRouteName() : string
- Makes the default route name more sane by removing common keywords.
- getGlobals() : mixed
- getAnnotations() : iterable<int, Route>
- resetGlobals() : array<string|int, mixed>
Properties
$defaultRouteIndex
protected
int
$defaultRouteIndex
= 0
$env
protected
mixed
$env
$reader
protected
mixed
$reader
$routeAnnotationClass
protected
string
$routeAnnotationClass
= \Symfony\Component\Routing\Annotation\Route::class
Methods
__construct()
public
__construct([Reader $reader = null ][, string $env = null ]) : mixed
Parameters
- $reader : Reader = null
- $env : string = null
getResolver()
Gets the loader resolver.
public
getResolver() : LoaderResolverInterface
Return values
LoaderResolverInterfaceload()
Loads from annotations from a class.
public
load(mixed $class[, string $type = null ]) : mixed
Parameters
- $class : mixed
- $type : string = null
Tags
setResolver()
Sets the loader resolver.
public
setResolver(LoaderResolverInterface $resolver) : mixed
Parameters
- $resolver : LoaderResolverInterface
setRouteAnnotationClass()
Sets the annotation class to read route properties from.
public
setRouteAnnotationClass(string $class) : mixed
Parameters
- $class : string
supports()
Returns whether this class supports the given resource.
public
supports(mixed $resource[, string $type = null ]) : bool
Parameters
- $resource : mixed
-
A resource
- $type : string = null
Return values
booladdRoute()
protected
addRoute(RouteCollection $collection, Route $annot, array<string|int, mixed> $globals, ReflectionClass $class, ReflectionMethod $method) : mixed
Parameters
- $collection : RouteCollection
- $annot : Route
-
or an object that exposes a similar interface
- $globals : array<string|int, mixed>
- $class : ReflectionClass
- $method : ReflectionMethod
configureRoute()
Configures the _controller default parameter of a given Route instance.
protected
configureRoute(Route $route, ReflectionClass $class, ReflectionMethod $method, object $annot) : mixed
Parameters
- $route : Route
- $class : ReflectionClass
- $method : ReflectionMethod
- $annot : object
createRoute()
protected
createRoute(string $path, array<string|int, mixed> $defaults, array<string|int, mixed> $requirements, array<string|int, mixed> $options, string|null $host, array<string|int, mixed> $schemes, array<string|int, mixed> $methods, string|null $condition) : mixed
Parameters
- $path : string
- $defaults : array<string|int, mixed>
- $requirements : array<string|int, mixed>
- $options : array<string|int, mixed>
- $host : string|null
- $schemes : array<string|int, mixed>
- $methods : array<string|int, mixed>
- $condition : string|null
getDefaultRouteName()
Makes the default route name more sane by removing common keywords.
protected
getDefaultRouteName(ReflectionClass $class, ReflectionMethod $method) : string
Parameters
- $class : ReflectionClass
- $method : ReflectionMethod
Return values
stringgetGlobals()
protected
getGlobals(ReflectionClass $class) : mixed
Parameters
- $class : ReflectionClass
getAnnotations()
private
getAnnotations(ReflectionClass|ReflectionMethod $reflection) : iterable<int, Route>
Parameters
- $reflection : ReflectionClass|ReflectionMethod
Return values
iterable<int, Route>resetGlobals()
private
resetGlobals() : array<string|int, mixed>