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

Breadcrumb

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

function ArrayRepository::hasPackage

@inheritDoc

Overrides RepositoryInterface::hasPackage

File

vendor/composer/composer/src/Composer/Repository/ArrayRepository.php, line 198

Class

ArrayRepository
A repository implementation that simply stores packages in an array

Namespace

Composer\Repository

Code

public function hasPackage(PackageInterface $package) {
    if ($this->packageMap === null) {
        $this->packageMap = [];
        foreach ($this->getPackages() as $repoPackage) {
            $this->packageMap[$repoPackage->getUniqueName()] = $repoPackage;
        }
    }
    return isset($this->packageMap[$package->getUniqueName()]);
}

API Navigation

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