You are here

protected function File_Iterator::acceptSubString in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/phpunit/php-file-iterator/src/Iterator.php \File_Iterator::acceptSubString()

@since Method available since Release 1.1.0

Parameters

string $filename:

array $subString:

int $type:

Return value

bool

2 calls to File_Iterator::acceptSubString()
File_Iterator::acceptPrefix in vendor/phpunit/php-file-iterator/src/Iterator.php
@since Method available since Release 1.1.0
File_Iterator::acceptSuffix in vendor/phpunit/php-file-iterator/src/Iterator.php
@since Method available since Release 1.1.0

File

vendor/phpunit/php-file-iterator/src/Iterator.php, line 139

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

protected function acceptSubString($filename, array $subStrings, $type) {
  if (empty($subStrings)) {
    return TRUE;
  }
  $matched = FALSE;
  foreach ($subStrings as $string) {
    if ($type == self::PREFIX && strpos($filename, $string) === 0 || $type == self::SUFFIX && substr($filename, -1 * strlen($string)) == $string) {
      $matched = TRUE;
      break;
    }
  }
  return $matched;
}