function LintCommand::getFiles
1 call to LintCommand::getFiles()
- LintCommand::execute in vendor/
symfony/ yaml/ Command/ LintCommand.php - Executes the current command.
File
-
vendor/
symfony/ yaml/ Command/ LintCommand.php, line 218
Class
- LintCommand
- Validates YAML files syntax and outputs encountered errors.
Namespace
Symfony\Component\Yaml\CommandCode
private function getFiles(string $fileOrDirectory) : iterable {
if (is_file($fileOrDirectory)) {
(yield new \SplFileInfo($fileOrDirectory));
return;
}
foreach ($this->getDirectoryIterator($fileOrDirectory) as $file) {
if (!\in_array($file->getExtension(), [
'yml',
'yaml',
])) {
continue;
}
(yield $file);
}
}