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

Breadcrumb

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

function GitBitbucketDriver::getChangeDate

@inheritDoc

Overrides VcsDriverInterface::getChangeDate

File

vendor/composer/composer/src/Composer/Repository/Vcs/GitBitbucketDriver.php, line 241

Class

GitBitbucketDriver
@author Per Bernhardt <plb@webfactory.de>

Namespace

Composer\Repository\Vcs

Code

public function getChangeDate(string $identifier) : ?\DateTimeImmutable {
    if ($this->fallbackDriver) {
        return $this->fallbackDriver
            ->getChangeDate($identifier);
    }
    if (strpos($identifier, '/') !== false) {
        $branches = $this->getBranches();
        if (isset($branches[$identifier])) {
            $identifier = $branches[$identifier];
        }
    }
    $resource = sprintf('https://api.bitbucket.org/2.0/repositories/%s/%s/commit/%s?fields=date', $this->owner, $this->repository, $identifier);
    $commit = $this->fetchWithOAuthCredentials($resource)
        ->decodeJson();
    return new \DateTimeImmutable($commit['date']);
}
RSS feed
Powered by Drupal