public function AbstractYamlPatternsDeriver::fileScanDirectory in UI Patterns 8
Wrapper method for global function call.
Overrides YamlPatternsDeriverInterface::fileScanDirectory
See also
1 call to AbstractYamlPatternsDeriver::fileScanDirectory()
- LibraryDeriver::getPatterns in modules/
ui_patterns_library/ src/ Plugin/ Deriver/ LibraryDeriver.php - Get pattern definition objects.
File
- src/
Plugin/ Deriver/ AbstractYamlPatternsDeriver.php, line 60
Class
- AbstractYamlPatternsDeriver
- Class AbstractYamlPatternsDeriver.
Namespace
Drupal\ui_patterns\Plugin\DeriverCode
public function fileScanDirectory($directory) {
if (!is_dir($directory)) {
return [];
}
$options = [
'nomask' => $this
->getNoMask(),
];
$extensions = $this
->getFileExtensions();
$extensions = array_map('preg_quote', $extensions);
$extensions = implode('|', $extensions);
$files = $this->fileSystem
->scanDirectory($directory, "/{$extensions}\$/", $options);
// In different file systems order of files in a folder can be different
// that can break tests. So let's sort them alphabetically manually.
ksort($files);
return $files;
}