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

Breadcrumb

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

function GitBitbucketDriver::getRepoData

Attempts to fetch the repository data via the BitBucket API and sets some parameters which are used in other methods

@phpstan-impure

1 call to GitBitbucketDriver::getRepoData()
GitBitbucketDriver::getRootIdentifier in vendor/composer/composer/src/Composer/Repository/Vcs/GitBitbucketDriver.php
@inheritDoc

File

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

Class

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

Namespace

Composer\Repository\Vcs

Code

protected function getRepoData() : bool {
    $resource = sprintf('https://api.bitbucket.org/2.0/repositories/%s/%s?%s', $this->owner, $this->repository, http_build_query([
        'fields' => '-project,-owner',
    ], '', '&'));
    $repoData = $this->fetchWithOAuthCredentials($resource, true)
        ->decodeJson();
    if ($this->fallbackDriver) {
        return false;
    }
    $this->parseCloneUrls($repoData['links']['clone']);
    $this->hasIssues = !empty($repoData['has_issues']);
    $this->branchesUrl = $repoData['links']['branches']['href'];
    $this->tagsUrl = $repoData['links']['tags']['href'];
    $this->homeUrl = $repoData['links']['html']['href'];
    $this->website = $repoData['website'];
    $this->vcsType = $repoData['scm'];
    $this->repoData = $repoData;
    return true;
}
RSS feed
Powered by Drupal