private static function getAllYamls(string $directory): \Generator
    {
        /** @var \SplFileInfo $file */
        foreach (new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($directory)) as $file) {
            if ($file->isFile() && $file->getExtension() === 'yml') {
                $fileName = $file->getPathname();
                yield $fileName => Yaml::parse(file_get_contents($fileName));
            }
        }
    }
private static function getAllYamls(string $directory): \Generator
    {
        /** @var \SplFileInfo $file */
        foreach (new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($directory)) as $file) {
            if ($file->isFile() && $file->getExtension() === 'yml') {
                $fileName = $file->getPathname();
                yield $fileName => Yaml::parse(file_get_contents($fileName));
            }
        }
    }
private static function getAllYamls ( string $ directory ) : \ Generator { /** @var \SplFileInfo $file */ foreach ( new \ RecursiveIteratorIterator ( new \ RecursiveDirectoryIterator ( $ directory ) ) as $ file ) { if ( $ file -> isFile ( ) && $ file -> getExtension ( ) === 'yml' ) { $ fileName = $ file -> getPathname ( ) ; yield $ fileName => Yaml :: parse ( file_get_contents ( $ fileName ) ) ; } } }
Get the contents of all yaml files in a directory, recursively.
@param string $directory
@return \Generator
Get the contents of all yaml files in a directory recursively .