YamlDirectoryDiscovery
class YamlDirectoryDiscovery implements DiscoverableInterface (View source)
Discovers multiple YAML files in a set of directories.
Constants
| FILE_KEY |
Defines the key in the discovered data where the file path is stored. |
Properties
| protected array | $directories | An array of directories to scan, keyed by the provider. |
|
| protected string | $fileCacheKeySuffix | The suffix for the file cache key. |
|
| protected string | $idKey | The key contained in the discovered data that identifies it. |
Methods
Constructs a YamlDirectoryDiscovery object.
Returns an array of discoverable items.
Gets the identifier from the data.
Returns an array of providers keyed by file path.
Gets an iterator to loop over the files in the provided directory.
Details
__construct(array $directories, string $file_cache_key_suffix, string $key = 'id')
Constructs a YamlDirectoryDiscovery object.
array
findAll()
Returns an array of discoverable items.
protected string
getIdentifier(string $file, array $data)
Gets the identifier from the data.
protected array
findFiles()
Returns an array of providers keyed by file path.
protected Traversable
getDirectoryIterator(string $directory)
Gets an iterator to loop over the files in the provided directory.
This method exists so that it is easy to replace this functionality in a class that extends this one. For example, it could be used to make the scan recursive.