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

Breadcrumb

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

function AddAnnotatedClassesToCachePass::matchAnyRegexps

1 call to AddAnnotatedClassesToCachePass::matchAnyRegexps()
AddAnnotatedClassesToCachePass::expandClasses in vendor/symfony/http-kernel/DependencyInjection/AddAnnotatedClassesToCachePass.php
Expands the given class patterns using a list of existing classes.

File

vendor/symfony/http-kernel/DependencyInjection/AddAnnotatedClassesToCachePass.php, line 128

Class

AddAnnotatedClassesToCachePass
Sets the classes to compile in the cache for the container.

Namespace

Symfony\Component\HttpKernel\DependencyInjection

Code

private function matchAnyRegexps(string $class, array $regexps) : bool {
    $isTest = str_contains($class, 'Test');
    foreach ($regexps as $regex) {
        if ($isTest && !str_contains($regex, 'Test')) {
            continue;
        }
        if (preg_match($regex, '\\' . $class)) {
            return true;
        }
    }
    return false;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal