src/Composer/Repository/ComposerRepository.php
public function findPackage($name, $constraint)
    {
        if (!$this->hasProviders()) {
            return parent::findPackage($name, $constraint);
        }

        $name = strtolower($name);
        if (!$constraint instanceof ConstraintInterface) {
            $versionParser = new VersionParser();
            $constraint = $versionParser->parseConstraints($constraint);
        }

        foreach ($this->getProviderNames() as $providerName) {
            if ($name === $providerName) {
                $packages = $this->whatProvides(new Pool('dev'), $providerName);
                foreach ($packages as $package) {
                    if ($name === $package->getName()) {
                        $pkgConstraint = new Constraint('==', $package->getVersion());
                        if ($constraint->matches($pkgConstraint)) {
                            return $package;
                        }
                    }
                }
                break;
            }
        }
    }
public function findPackage($name, $constraint)
    {
        if (!$this->hasProviders()) {
            return parent::findPackage($name, $constraint);
        }

        $name = strtolower($name);
        if (!$constraint instanceof ConstraintInterface) {
            $versionParser = new VersionParser();
            $constraint = $versionParser->parseConstraints($constraint);
        }

        foreach ($this->getProviderNames() as $providerName) {
            if ($name === $providerName) {
                $packages = $this->whatProvides(new Pool('dev'), $providerName);
                foreach ($packages as $package) {
                    if ($name === $package->getName()) {
                        $pkgConstraint = new Constraint('==', $package->getVersion());
                        if ($constraint->matches($pkgConstraint)) {
                            return $package;
                        }
                    }
                }
                break;
            }
        }
    }
public function findPackage ( $ name , $ constraint ) { if ( ! $ this -> hasProviders ( ) ) { return parent :: findPackage ( $ name , $ constraint ) ; } $ name = strtolower ( $ name ) ; if ( ! $ constraint instanceof ConstraintInterface ) { $ versionParser = new VersionParser ( ) ; $ constraint = $ versionParser -> parseConstraints ( $ constraint ) ; } foreach ( $ this -> getProviderNames ( ) as $ providerName ) { if ( $ name === $ providerName ) { $ packages = $ this -> whatProvides ( new Pool ( 'dev' ) , $ providerName ) ; foreach ( $ packages as $ package ) { if ( $ name === $ package -> getName ( ) ) { $ pkgConstraint = new Constraint ( '==' , $ package -> getVersion ( ) ) ; if ( $ constraint -> matches ( $ pkgConstraint ) ) { return $ package ; } } } break ; } } }
{@inheritDoc}
{