You are here

protected function YamlDirectoryDiscovery::findFiles in Drupal 8

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Component/Discovery/YamlDirectoryDiscovery.php \Drupal\Component\Discovery\YamlDirectoryDiscovery::findFiles()

Returns an array of providers keyed by file path.

Return value

array An array of providers keyed by file path.

1 call to YamlDirectoryDiscovery::findFiles()
YamlDirectoryDiscovery::findAll in core/lib/Drupal/Component/Discovery/YamlDirectoryDiscovery.php
Returns an array of discoverable items.

File

core/lib/Drupal/Component/Discovery/YamlDirectoryDiscovery.php, line 125

Class

YamlDirectoryDiscovery
Discovers multiple YAML files in a set of directories.

Namespace

Drupal\Component\Discovery

Code

protected function findFiles() {
  $file_list = [];
  foreach ($this->directories as $provider => $directories) {
    $directories = (array) $directories;
    foreach ($directories as $directory) {
      if (is_dir($directory)) {

        /** @var \SplFileInfo $fileInfo */
        foreach ($this
          ->getDirectoryIterator($directory) as $fileInfo) {
          $file_list[$fileInfo
            ->getPathname()] = $provider;
        }
      }
    }
  }
  return $file_list;
}