1
0
Fork 0

Don’t add github specials if there is no composer data

This can happen if an identifier doesn’t have a composer.json file (but other identifiers do)
pull/6053/head
Pete Akins 2017-01-04 21:29:38 -05:00 committed by Jordi Boggiano
parent 677e75d168
commit 95e9ad57d4
1 changed files with 9 additions and 7 deletions

View File

@ -152,14 +152,16 @@ class GitHubDriver extends VcsDriver
} }
$composer = $this->getBaseComposerInformation($identifier); $composer = $this->getBaseComposerInformation($identifier);
if ($composer) {
// specials for github // specials for github
if (!isset($composer['support']['source'])) { if (!isset($composer['support']['source'])) {
$label = array_search($identifier, $this->getTags()) ?: array_search($identifier, $this->getBranches()) ?: $identifier; $label = array_search($identifier, $this->getTags()) ?: array_search($identifier, $this->getBranches()) ?: $identifier;
$composer['support']['source'] = sprintf('https://%s/%s/%s/tree/%s', $this->originUrl, $this->owner, $this->repository, $label); $composer['support']['source'] = sprintf('https://%s/%s/%s/tree/%s', $this->originUrl, $this->owner, $this->repository, $label);
} }
if (!isset($composer['support']['issues']) && $this->hasIssues) { if (!isset($composer['support']['issues']) && $this->hasIssues) {
$composer['support']['issues'] = sprintf('https://%s/%s/%s/issues', $this->originUrl, $this->owner, $this->repository); $composer['support']['issues'] = sprintf('https://%s/%s/%s/issues', $this->originUrl, $this->owner, $this->repository);
}
} }
if ($this->shouldCache($identifier)) { if ($this->shouldCache($identifier)) {