public function File_Iterator::__construct

Parameters

Iterator $iterator:

array $suffixes:

array $prefixes:

array $exclude:

string $basepath:

File

drupal/core/vendor/phpunit/php-file-iterator/File/Iterator.php, line 87

Class

File_Iterator
FilterIterator implementation that filters files based on prefix(es) and/or suffix(es). Hidden files and files from hidden directories are also filtered.

Code

public function __construct(Iterator $iterator, array $suffixes = array(), array $prefixes = array(), array $exclude = array(), $basepath = NULL) {
  $exclude = array_filter(array_map('realpath', $exclude));
  if ($basepath !== NULL) {
    $basepath = realpath($basepath);
  }
  if ($basepath === FALSE) {
    $basepath = NULL;
  }
  else {
    foreach ($exclude as &$_exclude) {
      $_exclude = str_replace($basepath, '', $_exclude);
    }
  }
  $this->prefixes = $prefixes;
  $this->suffixes = $suffixes;
  $this->exclude = $exclude;
  $this->basepath = $basepath;
  parent::__construct($iterator);
}