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

Breadcrumb

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

function DefaultPolicy::replaces

Checks if source replaces a package with the same name as target.

Replace constraints are ignored. This method should only be used for prioritisation, not for actual constraint verification.

1 call to DefaultPolicy::replaces()
DefaultPolicy::compareByPriority in vendor/composer/composer/src/Composer/DependencyResolver/DefaultPolicy.php
@protected

File

vendor/composer/composer/src/Composer/DependencyResolver/DefaultPolicy.php, line 192

Class

DefaultPolicy
@author Nils Adermann <naderman@naderman.de> @author Jordi Boggiano <j.boggiano@seld.be>

Namespace

Composer\DependencyResolver

Code

protected function replaces(BasePackage $source, BasePackage $target) : bool {
    foreach ($source->getReplaces() as $link) {
        if ($link->getTarget() === $target->getName()) {
            return true;
        }
    }
    return false;
}

API Navigation

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