Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Iterator.php

function Iterator::acceptSubString

@psalm-param list<string> $subStrings

2 calls to Iterator::acceptSubString()
Iterator::acceptPrefix in vendor/phpunit/php-file-iterator/src/Iterator.php
Iterator::acceptSuffix in vendor/phpunit/php-file-iterator/src/Iterator.php

File

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

Class

Iterator
@template-extends FilterIterator<int, string, AppendIterator>

Namespace

SebastianBergmann\FileIterator

Code

private function acceptSubString(string $filename, array $subStrings, int $type) : bool {
    if (empty($subStrings)) {
        return true;
    }
    foreach ($subStrings as $string) {
        if ($type === self::PREFIX && str_starts_with($filename, $string) || $type === self::SUFFIX && str_ends_with($filename, $string)) {
            return true;
        }
    }
    return false;
}
RSS feed
Powered by Drupal