Documentation

AnnotationDirectoryLoader extends AnnotationFileLoader
in package

AnnotationDirectoryLoader loads routing information from annotations set on PHP classes and methods.

Tags
author

Fabien Potencier fabien@symfony.com

Table of Contents

$env  : mixed
$loader  : mixed
$loading  : mixed
$locator  : mixed
$resolver  : mixed
$currentDir  : mixed
__construct()  : mixed
getLocator()  : FileLocatorInterface
Returns the file locator used by this loader.
getResolver()  : LoaderResolverInterface
Gets the loader resolver.
import()  : mixed
Imports a resource.
load()  : RouteCollection
Loads from annotations from a directory.
resolve()  : LoaderInterface
Finds a loader able to load an imported resource.
setCurrentDir()  : mixed
Sets the current directory.
setResolver()  : mixed
Sets the loader resolver.
supports()  : mixed
{@inheritdoc}
findClass()  : string|false
Returns the full class name for the first class in the file.
doImport()  : mixed

Properties

$resolver

protected mixed $resolver

Methods

__construct()

public __construct([string|null $env = null ]) : mixed
Parameters
$env : string|null = null
Return values
mixed

import()

Imports a resource.

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

A resource

$type : string|null = null

The resource type or null if unknown

Return values
mixed

load()

Loads from annotations from a directory.

public load(string $path[, string|null $type = null ]) : RouteCollection
Parameters
$path : string

A directory path

$type : string|null = null

The resource type

Tags
throws
InvalidArgumentException

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

Return values
RouteCollection

resolve()

Finds a loader able to load an imported resource.

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

A resource

$type : string|null = null

The resource type or null if unknown

Tags
throws
LoaderLoadException

If no loader is found

Return values
LoaderInterface

setCurrentDir()

Sets the current directory.

public setCurrentDir(string $dir) : mixed
Parameters
$dir : string
Return values
mixed

supports()

{@inheritdoc}

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

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

doImport()

private doImport(mixed $resource[, string|null $type = null ][, bool $ignoreErrors = false ][, string|null $sourceResource = null ]) : mixed
Parameters
$resource : mixed
$type : string|null = null
$ignoreErrors : bool = false
$sourceResource : string|null = null
Return values
mixed

Search results