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

Breadcrumb

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

function GitHubDriver::getChangeDate

@inheritDoc

Overrides VcsDriverInterface::getChangeDate

File

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

Class

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

Namespace

Composer\Repository\Vcs

Code

public function getChangeDate(string $identifier) : ?\DateTimeImmutable {
    if ($this->gitDriver) {
        return $this->gitDriver
            ->getChangeDate($identifier);
    }
    $resource = $this->getApiUrl() . '/repos/' . $this->owner . '/' . $this->repository . '/commits/' . urlencode($identifier);
    $commit = $this->getContents($resource)
        ->decodeJson();
    return new \DateTimeImmutable($commit['commit']['committer']['date']);
}
RSS feed
Powered by Drupal