You are here

protected function AbstractYamlPatternsDeriver::getNoMask in UI Patterns 8

Returns a regular expression for directories to be excluded in a file scan.

Return value

string Regular expression.

1 call to AbstractYamlPatternsDeriver::getNoMask()
AbstractYamlPatternsDeriver::fileScanDirectory in src/Plugin/Deriver/AbstractYamlPatternsDeriver.php
Wrapper method for global function call.

File

src/Plugin/Deriver/AbstractYamlPatternsDeriver.php, line 81

Class

AbstractYamlPatternsDeriver
Class AbstractYamlPatternsDeriver.

Namespace

Drupal\ui_patterns\Plugin\Deriver

Code

protected function getNoMask() {
  $ignore = Settings::get('file_scan_ignore_directories', []);

  // We add 'tests' directory to the ones found in settings.
  $ignore[] = 'tests';
  array_walk($ignore, function (&$value) {
    $value = preg_quote($value, '/');
  });
  return '/^' . implode('|', $ignore) . '$/';
}