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

Breadcrumb

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

function GlobalState::processIncludedFilesAsString

@psalm-param list<string> $files

Throws

Exception

1 call to GlobalState::processIncludedFilesAsString()
GlobalState::getIncludedFilesAsString in vendor/phpunit/phpunit/src/Util/GlobalState.php

File

vendor/phpunit/phpunit/src/Util/GlobalState.php, line 140

Class

GlobalState
@no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit

Namespace

PHPUnit\Util

Code

public static function processIncludedFilesAsString(array $files) : string {
    $excludeList = new ExcludeList();
    $prefix = false;
    $result = '';
    if (defined('__PHPUNIT_PHAR__')) {
        $prefix = 'phar://' . __PHPUNIT_PHAR__ . '/';
    }
    // Do not process bootstrap script
    array_shift($files);
    // If bootstrap script was a Composer bin proxy, skip the second entry as well
    if (str_ends_with(strtr($files[0], '\\', '/'), '/phpunit/phpunit/phpunit')) {
        array_shift($files);
    }
    foreach (array_reverse($files) as $file) {
        if (!empty($GLOBALS['__PHPUNIT_ISOLATION_EXCLUDE_LIST']) && in_array($file, $GLOBALS['__PHPUNIT_ISOLATION_EXCLUDE_LIST'], true)) {
            continue;
        }
        if ($prefix !== false && str_starts_with($file, $prefix)) {
            continue;
        }
        // Skip virtual file system protocols
        if (preg_match('/^(vfs|phpvfs[a-z0-9]+):/', $file)) {
            continue;
        }
        if (!$excludeList->isExcluded($file) && is_file($file)) {
            $result = 'require_once \'' . $file . "';\n" . $result;
        }
    }
    return $result;
}
RSS feed
Powered by Drupal