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

Breadcrumb

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

function Loader::toAbsolutePath

@psalm-return non-empty-string

8 calls to Loader::toAbsolutePath()
Loader::codeCoverage in vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Loader.php
Loader::logging in vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Loader.php
Loader::php in vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Loader.php
Loader::phpunit in vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Loader.php
Loader::readFilterDirectories in vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Loader.php

... See full list

File

vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Loader.php, line 220

Class

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

Namespace

PHPUnit\TextUI\XmlConfiguration

Code

private function toAbsolutePath(string $filename, string $path) : string {
    $path = trim($path);
    if (str_starts_with($path, '/')) {
        return $path;
    }
    // Matches the following on Windows:
    //  - \\NetworkComputer\Path
    //  - \\.\D:
    //  - \\.\c:
    //  - C:\Windows
    //  - C:\windows
    //  - C:/windows
    //  - c:/windows
    if (defined('PHP_WINDOWS_VERSION_BUILD') && !empty($path) && ($path[0] === '\\' || strlen($path) >= 3 && preg_match('#^[A-Z]:[/\\\\]#i', substr($path, 0, 3)))) {
        return $path;
    }
    if (str_contains($path, '://')) {
        return $path;
    }
    return dirname($filename) . DIRECTORY_SEPARATOR . $path;
}

API Navigation

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