Documentation

AnnotationDirectoryLoader extends AttributeDirectoryLoader
in package

AttributeDirectoryLoader loads routing information from attributes set on PHP classes and methods.

since Symfony 6.4, to be removed in 7.0, use instead

Table of Contents

Properties

$env  : mixed
$loader  : mixed
$loading  : mixed
$locator  : mixed
$resolver  : mixed

Methods

__construct()  : mixed
getLocator()  : FileLocatorInterface
Returns the file locator used by this loader.
getResolver()  : LoaderResolverInterface
Gets the loader resolver.
import()  : mixed
Imports a resource.
load()  : mixed
Loads from attributes from a file.
resolve()  : LoaderInterface
Finds a loader able to load an imported resource.
setCurrentDir()  : void
Sets the current directory.
setResolver()  : void
Sets the loader resolver.
supports()  : bool
Returns whether this class supports the given resource.
findClass()  : string|false
Returns the full class name for the first class in the file.

Properties

$resolver

protected mixed $resolver

Methods

import()

Imports a resource.

public import(mixed $resource[, string|null $type = null ][, bool $ignoreErrors = false ][, string|null $sourceResource = null ][, string|array<string|int, string>|null $exclude = null ]) : mixed
Parameters
$resource : mixed

A Resource

$type : string|null = null

The resource type or null if unknown

$ignoreErrors : bool = false

Whether to ignore import errors or not

$sourceResource : string|null = null

The original resource importing the new resource

$exclude : string|array<string|int, string>|null = null

Glob patterns to exclude from the import

Tags
throws
LoaderLoadException
throws
FileLoaderImportCircularReferenceException
throws
FileLocatorFileNotFoundException

load()

Loads from attributes from a file.

public load(mixed $path[, string|null $type = null ]) : mixed
Parameters
$path : mixed
$type : string|null = null
Tags
throws
InvalidArgumentException

When the directory does not exist or its routes cannot be parsed

resolve()

Finds a loader able to load an imported resource.

public resolve(mixed $resource[, string|null $type = null ]) : LoaderInterface
Parameters
$resource : mixed
$type : string|null = null
Tags
throws
LoaderLoadException

If no loader is found

Return values
LoaderInterface

setCurrentDir()

Sets the current directory.

public setCurrentDir(string $dir) : void
Parameters
$dir : string

supports()

Returns whether this class supports the given resource.

public supports(mixed $resource[, string|null $type = null ]) : bool
Parameters
$resource : mixed

A resource

$type : string|null = null
Return values
bool

findClass()

Returns the full class name for the first class in the file.

protected findClass(string $file) : string|false
Parameters
$file : string
Return values
string|false

        
On this page

Search results