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

Breadcrumb

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

function Pool::computeWhatProvides

Parameters

string $name The package name to be searched for:

?ConstraintInterface $constraint A constraint that all returned: packages must match or null to return all

Return value

BasePackage[]

1 call to Pool::computeWhatProvides()
Pool::whatProvides in vendor/composer/composer/src/Composer/DependencyResolver/Pool.php
Searches all packages providing the given package name and match the constraint

File

vendor/composer/composer/src/Composer/DependencyResolver/Pool.php, line 156

Class

Pool
A package pool contains all packages for dependency resolution

Namespace

Composer\DependencyResolver

Code

private function computeWhatProvides(string $name, ?ConstraintInterface $constraint = null) : array {
    if (!isset($this->packageByName[$name])) {
        return [];
    }
    $matches = [];
    foreach ($this->packageByName[$name] as $candidate) {
        if ($this->match($candidate, $name, $constraint)) {
            $matches[] = $candidate;
        }
    }
    return $matches;
}

API Navigation

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