AnnotatedRouteControllerLoader

class AnnotatedRouteControllerLoader extends AnnotationClassLoader

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

Methods

__construct(Reader $reader)

Constructor.

from AnnotationClassLoader
setRouteAnnotationClass(string $class)

Sets the annotation class to read route properties from.

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

Loads from annotations from a class.

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

Returns whether this class supports the given resource.

from AnnotationClassLoader
setResolver(LoaderResolverInterface $resolver)

Sets the loader resolver.

from AnnotationClassLoader
LoaderResolverInterface getResolver()

Gets the loader resolver.

from AnnotationClassLoader

Details

__construct(Reader $reader)

Constructor.

Parameters

Reader $reader

setRouteAnnotationClass(string $class)

Sets the annotation class to read route properties from.

Parameters

string $class A fully-qualified class name

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

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

setResolver(LoaderResolverInterface $resolver)

Sets the loader resolver.

Parameters

LoaderResolverInterface $resolver A LoaderResolverInterface instance

LoaderResolverInterface getResolver()

Gets the loader resolver.

Return Value

LoaderResolverInterface A LoaderResolverInterface instance