/**
* {@inheritdoc}
*/
#[\ReturnTypeWillChange]
public function accept() { $name =
$this->
current()->
getFilename();
// FilesystemIterator::SKIP_DOTS only skips '.' and '..', but not hidden
// directories (like '.git').
if ($name[0
] == '.'
) { return FALSE;
} if ($this->
current()->
isDir()) { // If this is a subdirectory of a base search path, only recurse into the
// fixed list of expected extension type directory names. Required for
// scanning the top-level/root directory; without this condition, we would
// recurse into the whole filesystem tree that possibly contains other
// files aside from Drupal.
if ($this->
current()->
getSubPath() == ''
) { return in_array($name,
$this->allowedExtensionTypes, TRUE
);
} // 'config' directories are special-cased here, because every extension
// contains one. However, those default configuration directories cannot
// contain extensions. The directory name cannot be globally skipped,