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

Breadcrumb

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

function GitHubDriver::getSource

@inheritDoc

Overrides VcsDriverInterface::getSource

File

vendor/composer/composer/src/Composer/Repository/Vcs/GitHubDriver.php, line 127

Class

GitHubDriver
@author Jordi Boggiano <j.boggiano@seld.be>

Namespace

Composer\Repository\Vcs

Code

public function getSource(string $identifier) : array {
    if ($this->gitDriver) {
        return $this->gitDriver
            ->getSource($identifier);
    }
    if ($this->isPrivate) {
        // Private GitHub repositories should be accessed using the
        // SSH version of the URL.
        $url = $this->generateSshUrl();
    }
    else {
        $url = $this->getUrl();
    }
    return [
        'type' => 'git',
        'url' => $url,
        'reference' => $identifier,
    ];
}
RSS feed
Powered by Drupal