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

Breadcrumb

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

function BasePackage::setRepository

@inheritDoc

Overrides PackageInterface::setRepository

File

vendor/composer/composer/src/Composer/Package/BasePackage.php, line 141

Class

BasePackage
Base class for packages providing name storage and default match implementation

Namespace

Composer\Package

Code

public function setRepository(RepositoryInterface $repository) : void {
    if ($this->repository && $repository !== $this->repository) {
        throw new \LogicException(sprintf('Package "%s" cannot be added to repository "%s" as it is already in repository "%s".', $this->getPrettyName(), $repository->getRepoName(), $this->repository
            ->getRepoName()));
    }
    $this->repository = $repository;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal