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

Breadcrumb

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

function PathDownloader::getVcsReference

@inheritDoc

Overrides VcsCapableDownloaderInterface::getVcsReference

File

vendor/composer/composer/src/Composer/Downloader/PathDownloader.php, line 223

Class

PathDownloader
Download a package from a local path.

Namespace

Composer\Downloader

Code

public function getVcsReference(PackageInterface $package, string $path) : ?string {
    $path = Filesystem::trimTrailingSlash($path);
    $parser = new VersionParser();
    $guesser = new VersionGuesser($this->config, $this->process, $parser, $this->io);
    $dumper = new ArrayDumper();
    $packageConfig = $dumper->dump($package);
    $packageVersion = $guesser->guessVersion($packageConfig, $path);
    if ($packageVersion !== null) {
        return $packageVersion['commit'];
    }
    return null;
}

API Navigation

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