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

Breadcrumb

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

function ArrayRepository::removePackage

Removes package from repository.

Parameters

PackageInterface $package package instance:

Return value

void

File

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

Class

ArrayRepository
A repository implementation that simply stores packages in an array

Namespace

Composer\Repository

Code

public function removePackage(PackageInterface $package) {
    $packageId = $package->getUniqueName();
    foreach ($this->getPackages() as $key => $repoPackage) {
        if ($packageId === $repoPackage->getUniqueName()) {
            array_splice($this->packages, $key, 1);
            // invalidate package map cache
            $this->packageMap = null;
            return;
        }
    }
}

API Navigation

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