function YamlDiscovery::findFiles

Same name in other branches
  1. 9 core/lib/Drupal/Component/Discovery/YamlDiscovery.php \Drupal\Component\Discovery\YamlDiscovery::findFiles()
  2. 8.9.x core/lib/Drupal/Component/Discovery/YamlDiscovery.php \Drupal\Component\Discovery\YamlDiscovery::findFiles()
  3. 11.x core/lib/Drupal/Component/Discovery/YamlDiscovery.php \Drupal\Component\Discovery\YamlDiscovery::findFiles()

Returns an array of file paths, keyed by provider.

Return value

array

1 call to YamlDiscovery::findFiles()
YamlDiscovery::findAll in core/lib/Drupal/Component/Discovery/YamlDiscovery.php

File

core/lib/Drupal/Component/Discovery/YamlDiscovery.php, line 95

Class

YamlDiscovery
Provides discovery for YAML files within a given set of directories.

Namespace

Drupal\Component\Discovery

Code

protected function findFiles() {
    $files = [];
    foreach ($this->directories as $provider => $directory) {
        $file = $directory . '/' . $provider . '.' . $this->name . '.yml';
        if (file_exists($file)) {
            $files[$provider] = $file;
        }
    }
    return $files;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.