class AnnotatedRouteControllerLoader extends AnnotationClassLoader

AnnotatedRouteControllerLoader is an implementation of AnnotationClassLoader that sets the '_controller' default based on the class and method names.

Properties

protected $reader from AnnotationClassLoader
protected string $routeAnnotationClass from AnnotationClassLoader
protected int $defaultRouteIndex from AnnotationClassLoader

Methods

__construct(Reader $reader)

No description

setRouteAnnotationClass(string $class)

Sets the annotation class to read route properties from.

load(string $class, string|null $type = null)

Loads from annotations from a class.

addRoute(RouteCollection $collection, $annot, $globals, ReflectionClass $class, ReflectionMethod $method)

No description

bool
supports(mixed $resource, string|null $type = null)

Returns whether this class supports the given resource.

setResolver(LoaderResolverInterface $resolver)

Sets the loader resolver.

getResolver()

Gets the loader resolver.

string
getDefaultRouteName(ReflectionClass $class, ReflectionMethod $method)

Makes the default route name more sane by removing common keywords.

getGlobals(ReflectionClass $class)

No description

createRoute($path, $defaults, $requirements, $options, $host, $schemes, $methods, $condition)

No description

configureRoute(Route $route, ReflectionClass $class, ReflectionMethod $method, $annot)

Configures the _controller default parameter of a given Route instance.

Details

in AnnotationClassLoader at line 72
__construct(Reader $reader)

Parameters

Reader $reader

in AnnotationClassLoader at line 82
setRouteAnnotationClass(string $class)

Sets the annotation class to read route properties from.

Parameters

string $class A fully-qualified class name

in AnnotationClassLoader at line 97
load(string $class, string|null $type = null)

Loads from annotations from a class.

Parameters

string $class A class name
string|null $type The resource type or null if unknown

Exceptions

InvalidArgumentException When route can't be parsed

in AnnotationClassLoader at line 134
protected addRoute(RouteCollection $collection, $annot, $globals, ReflectionClass $class, ReflectionMethod $method)

Parameters

RouteCollection $collection
$annot
$globals
ReflectionClass $class
ReflectionMethod $method

in AnnotationClassLoader at line 173
bool supports(mixed $resource, string|null $type = null)

Returns whether this class supports the given resource.

Parameters

mixed $resource A resource
string|null $type The resource type or null if unknown

Return Value

bool True if this class supports the given resource, false otherwise

in AnnotationClassLoader at line 181
setResolver(LoaderResolverInterface $resolver)

Sets the loader resolver.

Parameters

LoaderResolverInterface $resolver

in AnnotationClassLoader at line 188
LoaderResolverInterface getResolver()

Gets the loader resolver.

Return Value

LoaderResolverInterface A LoaderResolverInterface instance

at line 44
protected string getDefaultRouteName(ReflectionClass $class, ReflectionMethod $method)

Makes the default route name more sane by removing common keywords.

Parameters

ReflectionClass $class
ReflectionMethod $method

Return Value

string

in AnnotationClassLoader at line 211
protected getGlobals(ReflectionClass $class)

Parameters

ReflectionClass $class

in AnnotationClassLoader at line 271
protected createRoute($path, $defaults, $requirements, $options, $host, $schemes, $methods, $condition)

Parameters

$path
$defaults
$requirements
$options
$host
$schemes
$methods
$condition

at line 30
protected configureRoute(Route $route, ReflectionClass $class, ReflectionMethod $method, $annot)

Configures the _controller default parameter of a given Route instance.

Parameters

Route $route
ReflectionClass $class
ReflectionMethod $method
$annot