function RecursiveExtensionFilterCallback::__construct

Same name in other branches
  1. 11.x core/lib/Drupal/Core/Extension/Discovery/RecursiveExtensionFilterCallback.php \Drupal\Core\Extension\Discovery\RecursiveExtensionFilterCallback::__construct()

Construct a RecursiveExtensionFilterCallback.

Parameters

array $skipped_folders: (optional) Add to the list of directories that should be filtered out during the iteration.

bool $accept_tests: (optional) Pass FALSE to skip all test directories in the discovery. If TRUE, extensions in test directories will be discovered and only the global directory skip list in RecursiveExtensionFilterCallback::$skippedFolders and $skipped_folders are applied.

File

core/lib/Drupal/Core/Extension/Discovery/RecursiveExtensionFilterCallback.php, line 89

Class

RecursiveExtensionFilterCallback
Filters a RecursiveDirectoryIterator to discover extensions.

Namespace

Drupal\Core\Extension\Discovery

Code

public function __construct(array $skipped_folders = [], bool $accept_tests = FALSE) {
    $this->skippedFolders = array_merge($this->skippedFolders, $skipped_folders);
    if (!$accept_tests) {
        $this->skippedFolders[] = 'tests';
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.