Skip to content

Commit

Permalink
EZEE-3465: Tweaks to RepositoryConfigurationProvider
Browse files Browse the repository at this point in the history
  • Loading branch information
barw4 committed Feb 5, 2021
1 parent 3cf8e0d commit e5c9818
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function getRepositoryConfig()
// Takes configured repository as the reference, if it exists.
// If not, the first configured repository is considered instead.
$repositoryAlias = $this->configResolver->getParameter('repository');
$repositoryAlias = $repositoryAlias ?: $this->pullDefaultRepository();
$repositoryAlias = $repositoryAlias ?: $this->getDefaultRepositoryAlias();

if (empty($repositoryAlias) || !isset($this->repositories[$repositoryAlias])) {
throw new InvalidRepositoryException(
Expand All @@ -51,7 +51,12 @@ public function getRepositoryConfig()
return ['alias' => $repositoryAlias] + $this->repositories[$repositoryAlias];
}

public function pullDefaultRepository(): ?string
public function getCurrentRepositoryAlias(): string
{
return $this->getRepositoryConfig()['alias'];
}

public function getDefaultRepositoryAlias(): ?string
{
$aliases = array_keys($this->repositories);

Expand Down

0 comments on commit e5c9818

Please sign in to comment.