original_string: protected function replaces(PackageInterface $source, PackageInterface $target)
      {
          foreach ($source->getReplaces() as $link) {
              if ($link->getTarget() === $target->getName()
  //                && (null === $link->getConstraint() ||
  //                $link->getConstraint()->matches(new VersionConstraint('==', $target->getVersion())))) {
                  ) {
                  return true;
              }
          }
  
          return false;
      }
code: protected function replaces(PackageInterface $source, PackageInterface $target)
      {
          foreach ($source->getReplaces() as $link) {
              if ($link->getTarget() === $target->getName()
  //                && (null === $link->getConstraint() ||
  //                $link->getConstraint()->matches(new VersionConstraint('==', $target->getVersion())))) {
                  ) {
                  return true;
              }
          }
  
          return false;
      }
code_tokens: protected function replaces ( PackageInterface $ source , PackageInterface $ target ) { foreach ( $ source -> getReplaces ( ) as $ link ) { if ( $ link -> getTarget ( ) === $ target -> getName ( ) //                && (null === $link->getConstraint() || //                $link->getConstraint()->matches(new VersionConstraint('==', $target->getVersion())))) { ) { return true ; } } return false ; }
docstring: 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.
  
  @param  PackageInterface $source
  @param  PackageInterface $target
  @return bool
docstring_tokens: Checks if source replaces a package with the same name as target .