public function File_Iterator::accept

Return value

boolean

File

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

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 accept() {
  $current = $this
    ->getInnerIterator()
    ->current();
  $filename = $current
    ->getFilename();
  $realpath = $current
    ->getRealPath();
  if ($this->basepath !== NULL) {
    $realpath = str_replace($this->basepath, '', $realpath);
  }

  // Filter files in hidden directories.
  if (preg_match('=/\\.[^/]*/=', $realpath)) {
    return FALSE;
  }
  return $this
    ->acceptPath($realpath) && $this
    ->acceptPrefix($filename) && $this
    ->acceptSuffix($filename);
}