class SymfonyFileLocator implements FileLocator (View source)

The Symfony File Locator makes a simplifying assumptions compared to the DefaultFileLocator. By assuming paths only contain entities of a certain namespace the mapping files consists of the short classname only.

Properties

protected array $paths The paths where to look for mapping files.
protected array $prefixes A map of mapping directory path to namespace prefix used to expand class shortnames.
protected string $fileExtension File extension that is searched for.

Methods

__construct(array $prefixes, $fileExtension = null)

No description

addNamespacePrefixes(array $prefixes)

No description

getNamespacePrefixes()

No description

array
getPaths()

Get all the paths that this file locator looks for mapping files.

string
getFileExtension()

Get the file extension that mapping files are suffixed with.

void
setFileExtension(string $fileExtension)

Set the file extension used to look for mapping files under

bool
fileExists($className)

Check if a file can be found for this class name.

array
getAllClassNames(string $globalBasename = null)

Get all class names that are found with this file locator.

string
findMappingFile(string $className)

Locate mapping file for the given class name.

Details

__construct(array $prefixes, $fileExtension = null)

Parameters

array $prefixes
$fileExtension

addNamespacePrefixes(array $prefixes)

Parameters

array $prefixes

getNamespacePrefixes()

array getPaths()

Get all the paths that this file locator looks for mapping files.

Return Value

array

string getFileExtension()

Get the file extension that mapping files are suffixed with.

Return Value

string

void setFileExtension(string $fileExtension)

Set the file extension used to look for mapping files under

Parameters

string $fileExtension The file extension to set

Return Value

void

bool fileExists($className)

Check if a file can be found for this class name.

Parameters

$className

Return Value

bool

array getAllClassNames(string $globalBasename = null)

Get all class names that are found with this file locator.

Parameters

string $globalBasename Passed to allow excluding the basename

Return Value

array

string findMappingFile(string $className)

Locate mapping file for the given class name.

Parameters

string $className

Return Value

string