replace all occurences in code and comments

main
Rob Bast 9 years ago
parent 1ccfc8eb96
commit a1427d7fd6

@ -36,7 +36,7 @@ use Composer\Json\JsonFile;
use Composer\Config\JsonConfigSource; use Composer\Config\JsonConfigSource;
use Composer\Util\Filesystem; use Composer\Util\Filesystem;
use Composer\Util\RemoteFilesystem; use Composer\Util\RemoteFilesystem;
use Composer\Package\Version\VersionParser; use Composer\Semver\VersionParser;
/** /**
* Install a package as new project into new directory. * Install a package as new project into new directory.

@ -19,7 +19,7 @@ use Composer\Package\BasePackage;
use Composer\Package\Version\VersionSelector; use Composer\Package\Version\VersionSelector;
use Composer\Repository\CompositeRepository; use Composer\Repository\CompositeRepository;
use Composer\Repository\PlatformRepository; use Composer\Repository\PlatformRepository;
use Composer\Package\Version\VersionParser; use Composer\Semver\VersionParser;
use Composer\Util\ProcessExecutor; use Composer\Util\ProcessExecutor;
use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Input\InputOption;

@ -20,7 +20,7 @@ use Composer\Factory;
use Composer\Installer; use Composer\Installer;
use Composer\Json\JsonFile; use Composer\Json\JsonFile;
use Composer\Json\JsonManipulator; use Composer\Json\JsonManipulator;
use Composer\Package\Version\VersionParser; use Composer\Semver\VersionParser;
use Composer\Plugin\CommandEvent; use Composer\Plugin\CommandEvent;
use Composer\Plugin\PluginEvents; use Composer\Plugin\PluginEvents;
use Composer\Repository\CompositeRepository; use Composer\Repository\CompositeRepository;

@ -16,7 +16,7 @@ use Composer\DependencyResolver\Pool;
use Composer\DependencyResolver\DefaultPolicy; use Composer\DependencyResolver\DefaultPolicy;
use Composer\Factory; use Composer\Factory;
use Composer\Package\CompletePackageInterface; use Composer\Package\CompletePackageInterface;
use Composer\Package\Version\VersionParser; use Composer\Semver\VersionParser;
use Composer\Plugin\CommandEvent; use Composer\Plugin\CommandEvent;
use Composer\Plugin\PluginEvents; use Composer\Plugin\PluginEvents;
use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputInterface;

@ -15,7 +15,7 @@ namespace Composer\DependencyResolver;
use Composer\Package\PackageInterface; use Composer\Package\PackageInterface;
use Composer\Package\AliasPackage; use Composer\Package\AliasPackage;
use Composer\Package\BasePackage; use Composer\Package\BasePackage;
use Composer\Package\LinkConstraint\VersionConstraint; use Composer\Semver\Constraint\Constraint;
/** /**
* @author Nils Adermann <naderman@naderman.de> * @author Nils Adermann <naderman@naderman.de>
@ -38,8 +38,8 @@ class DefaultPolicy implements PolicyInterface
return BasePackage::$stabilities[$stabA] < BasePackage::$stabilities[$stabB]; return BasePackage::$stabilities[$stabA] < BasePackage::$stabilities[$stabB];
} }
$constraint = new VersionConstraint($operator, $b->getVersion()); $constraint = new Constraint($operator, $b->getVersion());
$version = new VersionConstraint('==', $a->getVersion()); $version = new Constraint('==', $a->getVersion());
return $constraint->matchSpecific($version, true); return $constraint->matchSpecific($version, true);
} }
@ -194,7 +194,7 @@ class DefaultPolicy implements PolicyInterface
foreach ($source->getReplaces() as $link) { foreach ($source->getReplaces() as $link) {
if ($link->getTarget() === $target->getName() if ($link->getTarget() === $target->getName()
// && (null === $link->getConstraint() || // && (null === $link->getConstraint() ||
// $link->getConstraint()->matches(new VersionConstraint('==', $target->getVersion())))) { // $link->getConstraint()->matches(new Constraint('==', $target->getVersion())))) {
) { ) {
return true; return true;
} }

@ -14,10 +14,10 @@ namespace Composer\DependencyResolver;
use Composer\Package\BasePackage; use Composer\Package\BasePackage;
use Composer\Package\AliasPackage; use Composer\Package\AliasPackage;
use Composer\Package\Version\VersionParser; use Composer\Semver\VersionParser;
use Composer\Package\LinkConstraint\LinkConstraintInterface; use Composer\Semver\Constraint\ConstraintInterface;
use Composer\Package\LinkConstraint\VersionConstraint; use Composer\Semver\Constraint\Constraint;
use Composer\Package\LinkConstraint\EmptyConstraint; use Composer\Semver\Constraint\EmptyConstraint;
use Composer\Repository\RepositoryInterface; use Composer\Repository\RepositoryInterface;
use Composer\Repository\CompositeRepository; use Composer\Repository\CompositeRepository;
use Composer\Repository\ComposerRepository; use Composer\Repository\ComposerRepository;
@ -171,14 +171,14 @@ class Pool implements \Countable
/** /**
* Searches all packages providing the given package name and match the constraint * Searches all packages providing the given package name and match the constraint
* *
* @param string $name The package name to be searched for * @param string $name The package name to be searched for
* @param LinkConstraintInterface $constraint A constraint that all returned * @param ConstraintInterface $constraint A constraint that all returned
* packages must match or null to return all * packages must match or null to return all
* @param bool $mustMatchName Whether the name of returned packages * @param bool $mustMatchName Whether the name of returned packages
* must match the given name * must match the given name
* @return PackageInterface[] A set of packages * @return PackageInterface[] A set of packages
*/ */
public function whatProvides($name, LinkConstraintInterface $constraint = null, $mustMatchName = false) public function whatProvides($name, ConstraintInterface $constraint = null, $mustMatchName = false)
{ {
$key = ((int) $mustMatchName).$constraint; $key = ((int) $mustMatchName).$constraint;
if (isset($this->providerCache[$name][$key])) { if (isset($this->providerCache[$name][$key])) {
@ -317,12 +317,12 @@ class Pool implements \Countable
* Checks if the package matches the given constraint directly or through * Checks if the package matches the given constraint directly or through
* provided or replaced packages * provided or replaced packages
* *
* @param array|PackageInterface $candidate * @param array|PackageInterface $candidate
* @param string $name Name of the package to be matched * @param string $name Name of the package to be matched
* @param LinkConstraintInterface $constraint The constraint to verify * @param ConstraintInterface $constraint The constraint to verify
* @return int One of the MATCH* constants of this class or 0 if there is no match * @return int One of the MATCH* constants of this class or 0 if there is no match
*/ */
private function match($candidate, $name, LinkConstraintInterface $constraint = null) private function match($candidate, $name, ConstraintInterface $constraint = null)
{ {
$candidateName = $candidate->getName(); $candidateName = $candidate->getName();
$candidateVersion = $candidate->getVersion(); $candidateVersion = $candidate->getVersion();
@ -336,7 +336,7 @@ class Pool implements \Countable
} }
if ($candidateName === $name) { if ($candidateName === $name) {
$pkgConstraint = new VersionConstraint('==', $candidateVersion); $pkgConstraint = new Constraint('==', $candidateVersion);
if ($constraint === null || $constraint->matches($pkgConstraint)) { if ($constraint === null || $constraint->matches($pkgConstraint)) {
return $requireFilter->matches($pkgConstraint) ? self::MATCH : self::MATCH_FILTERED; return $requireFilter->matches($pkgConstraint) ? self::MATCH : self::MATCH_FILTERED;

@ -222,7 +222,7 @@ class Problem
/** /**
* Turns a constraint into text usable in a sentence describing a job * Turns a constraint into text usable in a sentence describing a job
* *
* @param \Composer\Package\LinkConstraint\LinkConstraintInterface $constraint * @param \Composer\Semver\Constraint\ConstraintInterface $constraint
* @return string * @return string
*/ */
protected function constraintToText($constraint) protected function constraintToText($constraint)

@ -12,7 +12,7 @@
namespace Composer\DependencyResolver; namespace Composer\DependencyResolver;
use Composer\Package\LinkConstraint\LinkConstraintInterface; use Composer\Semver\Constraint\ConstraintInterface;
/** /**
* @author Nils Adermann <naderman@naderman.de> * @author Nils Adermann <naderman@naderman.de>
@ -26,17 +26,17 @@ class Request
$this->jobs = array(); $this->jobs = array();
} }
public function install($packageName, LinkConstraintInterface $constraint = null) public function install($packageName, ConstraintInterface $constraint = null)
{ {
$this->addJob($packageName, 'install', $constraint); $this->addJob($packageName, 'install', $constraint);
} }
public function update($packageName, LinkConstraintInterface $constraint = null) public function update($packageName, ConstraintInterface $constraint = null)
{ {
$this->addJob($packageName, 'update', $constraint); $this->addJob($packageName, 'update', $constraint);
} }
public function remove($packageName, LinkConstraintInterface $constraint = null) public function remove($packageName, ConstraintInterface $constraint = null)
{ {
$this->addJob($packageName, 'remove', $constraint); $this->addJob($packageName, 'remove', $constraint);
} }
@ -46,12 +46,12 @@ class Request
* *
* These jobs will not be tempered with by the solver * These jobs will not be tempered with by the solver
*/ */
public function fix($packageName, LinkConstraintInterface $constraint = null) public function fix($packageName, ConstraintInterface $constraint = null)
{ {
$this->addJob($packageName, 'install', $constraint, true); $this->addJob($packageName, 'install', $constraint, true);
} }
protected function addJob($packageName, $cmd, LinkConstraintInterface $constraint = null, $fixed = false) protected function addJob($packageName, $cmd, ConstraintInterface $constraint = null, $fixed = false)
{ {
$packageName = strtolower($packageName); $packageName = strtolower($packageName);

@ -24,7 +24,7 @@ use Composer\Util\RemoteFilesystem;
use Symfony\Component\Console\Formatter\OutputFormatterStyle; use Symfony\Component\Console\Formatter\OutputFormatterStyle;
use Composer\EventDispatcher\EventDispatcher; use Composer\EventDispatcher\EventDispatcher;
use Composer\Autoload\AutoloadGenerator; use Composer\Autoload\AutoloadGenerator;
use Composer\Package\Version\VersionParser; use Composer\Semver\VersionParser;
/** /**
* Creates a configured instance of composer. * Creates a configured instance of composer.

@ -34,7 +34,7 @@ use Composer\Json\JsonFile;
use Composer\Package\AliasPackage; use Composer\Package\AliasPackage;
use Composer\Package\CompletePackage; use Composer\Package\CompletePackage;
use Composer\Package\Link; use Composer\Package\Link;
use Composer\Package\LinkConstraint\VersionConstraint; use Composer\Semver\Constraint\Constraint;
use Composer\Package\Locker; use Composer\Package\Locker;
use Composer\Package\PackageInterface; use Composer\Package\PackageInterface;
use Composer\Package\RootPackageInterface; use Composer\Package\RootPackageInterface;
@ -428,7 +428,7 @@ class Installer
&& $this->installationManager->isPackageInstalled($localRepo, $package) && $this->installationManager->isPackageInstalled($localRepo, $package)
) { ) {
$removedUnstablePackages[$package->getName()] = true; $removedUnstablePackages[$package->getName()] = true;
$request->remove($package->getName(), new VersionConstraint('=', $package->getVersion())); $request->remove($package->getName(), new Constraint('=', $package->getVersion()));
} }
} }
} }
@ -467,7 +467,7 @@ class Installer
foreach ($currentPackages as $curPackage) { foreach ($currentPackages as $curPackage) {
if ($curPackage->getName() === $candidate) { if ($curPackage->getName() === $candidate) {
if (!$this->isUpdateable($curPackage) && !isset($removedUnstablePackages[$curPackage->getName()])) { if (!$this->isUpdateable($curPackage) && !isset($removedUnstablePackages[$curPackage->getName()])) {
$constraint = new VersionConstraint('=', $curPackage->getVersion()); $constraint = new Constraint('=', $curPackage->getVersion());
$request->install($curPackage->getName(), $constraint); $request->install($curPackage->getName(), $constraint);
} }
break; break;
@ -487,7 +487,7 @@ class Installer
if (isset($aliases[$package->getName()][$version])) { if (isset($aliases[$package->getName()][$version])) {
$version = $aliases[$package->getName()][$version]['alias_normalized']; $version = $aliases[$package->getName()][$version]['alias_normalized'];
} }
$constraint = new VersionConstraint('=', $version); $constraint = new Constraint('=', $version);
$constraint->setPrettyString($package->getPrettyVersion()); $constraint->setPrettyString($package->getPrettyVersion());
$request->install($package->getName(), $constraint); $request->install($package->getName(), $constraint);
} }
@ -712,7 +712,7 @@ class Installer
$requires = array(); $requires = array();
foreach ($lockedRepository->getPackages() as $package) { foreach ($lockedRepository->getPackages() as $package) {
$constraint = new VersionConstraint('=', $package->getVersion()); $constraint = new Constraint('=', $package->getVersion());
$constraint->setPrettyString($package->getPrettyVersion()); $constraint->setPrettyString($package->getPrettyVersion());
$requires[$package->getName()] = $constraint; $requires[$package->getName()] = $constraint;
} }
@ -774,7 +774,7 @@ class Installer
{ {
$request = new Request(); $request = new Request();
$constraint = new VersionConstraint('=', $rootPackage->getVersion()); $constraint = new Constraint('=', $rootPackage->getVersion());
$constraint->setPrettyString($rootPackage->getPrettyVersion()); $constraint->setPrettyString($rootPackage->getPrettyVersion());
$request->install($rootPackage->getName(), $constraint); $request->install($rootPackage->getName(), $constraint);
@ -788,7 +788,7 @@ class Installer
// to prevent the solver trying to remove or update those // to prevent the solver trying to remove or update those
$provided = $rootPackage->getProvides(); $provided = $rootPackage->getProvides();
foreach ($fixedPackages as $package) { foreach ($fixedPackages as $package) {
$constraint = new VersionConstraint('=', $package->getVersion()); $constraint = new Constraint('=', $package->getVersion());
$constraint->setPrettyString($package->getPrettyVersion()); $constraint->setPrettyString($package->getPrettyVersion());
// skip platform packages that are provided by the root package // skip platform packages that are provided by the root package
@ -893,7 +893,7 @@ class Installer
} }
// find similar packages (name/version) in all repositories // find similar packages (name/version) in all repositories
$matches = $pool->whatProvides($package->getName(), new VersionConstraint('=', $package->getVersion())); $matches = $pool->whatProvides($package->getName(), new Constraint('=', $package->getVersion()));
foreach ($matches as $index => $match) { foreach ($matches as $index => $match) {
// skip local packages // skip local packages
if (!in_array($match->getRepository(), $repositories, true)) { if (!in_array($match->getRepository(), $repositories, true)) {
@ -1003,7 +1003,7 @@ class Installer
foreach ($localRepo->getCanonicalPackages() as $package) { foreach ($localRepo->getCanonicalPackages() as $package) {
// find similar packages (name/version) in all repositories // find similar packages (name/version) in all repositories
$matches = $pool->whatProvides($package->getName(), new VersionConstraint('=', $package->getVersion())); $matches = $pool->whatProvides($package->getName(), new Constraint('=', $package->getVersion()));
foreach ($matches as $index => $match) { foreach ($matches as $index => $match) {
// skip local packages // skip local packages
if (!in_array($match->getRepository(), $repositories, true)) { if (!in_array($match->getRepository(), $repositories, true)) {

@ -12,8 +12,8 @@
namespace Composer\Package; namespace Composer\Package;
use Composer\Package\LinkConstraint\VersionConstraint; use Composer\Semver\Constraint\Constraint;
use Composer\Package\Version\VersionParser; use Composer\Semver\VersionParser;
/** /**
* @author Jordi Boggiano <j.boggiano@seld.be> * @author Jordi Boggiano <j.boggiano@seld.be>
@ -174,14 +174,14 @@ class AliasPackage extends BasePackage implements CompletePackageInterface
foreach ($links as $link) { foreach ($links as $link) {
// link is self.version, but must be replacing also the replaced version // link is self.version, but must be replacing also the replaced version
if ('self.version' === $link->getPrettyConstraint()) { if ('self.version' === $link->getPrettyConstraint()) {
$newLinks[] = new Link($link->getSource(), $link->getTarget(), new VersionConstraint('=', $this->version), $linkType, $this->prettyVersion); $newLinks[] = new Link($link->getSource(), $link->getTarget(), new Constraint('=', $this->version), $linkType, $this->prettyVersion);
} }
} }
$links = array_merge($links, $newLinks); $links = array_merge($links, $newLinks);
} else { } else {
foreach ($links as $index => $link) { foreach ($links as $index => $link) {
if ('self.version' === $link->getPrettyConstraint()) { if ('self.version' === $link->getPrettyConstraint()) {
$links[$index] = new Link($link->getSource(), $link->getTarget(), new VersionConstraint('=', $this->version), $linkType, $this->prettyVersion); $links[$index] = new Link($link->getSource(), $link->getTarget(), new Constraint('=', $this->version), $linkType, $this->prettyVersion);
} }
} }
} }

@ -12,7 +12,7 @@
namespace Composer\Package; namespace Composer\Package;
use Composer\Package\LinkConstraint\LinkConstraintInterface; use Composer\Semver\Constraint\ConstraintInterface;
/** /**
* Represents a link between two packages, represented by their names * Represents a link between two packages, represented by their names
@ -32,7 +32,7 @@ class Link
protected $target; protected $target;
/** /**
* @var LinkConstraintInterface|null * @var ConstraintInterface|null
*/ */
protected $constraint; protected $constraint;
@ -49,13 +49,13 @@ class Link
/** /**
* Creates a new package link. * Creates a new package link.
* *
* @param string $source * @param string $source
* @param string $target * @param string $target
* @param LinkConstraintInterface|null $constraint Constraint applying to the target of this link * @param ConstraintInterface|null $constraint Constraint applying to the target of this link
* @param string $description Used to create a descriptive string representation * @param string $description Used to create a descriptive string representation
* @param string|null $prettyConstraint * @param string|null $prettyConstraint
*/ */
public function __construct($source, $target, LinkConstraintInterface $constraint = null, $description = 'relates to', $prettyConstraint = null) public function __construct($source, $target, ConstraintInterface $constraint = null, $description = 'relates to', $prettyConstraint = null)
{ {
$this->source = strtolower($source); $this->source = strtolower($source);
$this->target = strtolower($target); $this->target = strtolower($target);
@ -81,7 +81,7 @@ class Link
} }
/** /**
* @return LinkConstraintInterface|null * @return ConstraintInterface|null
*/ */
public function getConstraint() public function getConstraint()
{ {

@ -17,7 +17,7 @@ use Composer\Package\AliasPackage;
use Composer\Package\Link; use Composer\Package\Link;
use Composer\Package\RootAliasPackage; use Composer\Package\RootAliasPackage;
use Composer\Package\RootPackageInterface; use Composer\Package\RootPackageInterface;
use Composer\Package\Version\VersionParser; use Composer\Semver\VersionParser;
/** /**
* @author Konstantin Kudryashiv <ever.zet@gmail.com> * @author Konstantin Kudryashiv <ever.zet@gmail.com>

@ -17,7 +17,7 @@ use Composer\Package\AliasPackage;
use Composer\Config; use Composer\Config;
use Composer\Factory; use Composer\Factory;
use Composer\Package\Version\VersionGuesser; use Composer\Package\Version\VersionGuesser;
use Composer\Package\Version\VersionParser; use Composer\Semver\VersionParser;
use Composer\Repository\RepositoryManager; use Composer\Repository\RepositoryManager;
use Composer\Util\ProcessExecutor; use Composer\Util\ProcessExecutor;

@ -14,8 +14,8 @@ namespace Composer\Package\Loader;
use Composer\Package; use Composer\Package;
use Composer\Package\BasePackage; use Composer\Package\BasePackage;
use Composer\Package\LinkConstraint\VersionConstraint; use Composer\Semver\Constraint\Constraint;
use Composer\Package\Version\VersionParser; use Composer\Semver\VersionParser;
use Composer\Repository\PlatformRepository; use Composer\Repository\PlatformRepository;
/** /**
@ -149,7 +149,7 @@ class ValidatingArrayLoader implements LoaderInterface
} }
} }
$unboundConstraint = new VersionConstraint('=', $this->versionParser->normalize('dev-master')); $unboundConstraint = new Constraint('=', $this->versionParser->normalize('dev-master'));
foreach (array_keys(BasePackage::$supportedLinkTypes) as $linkType) { foreach (array_keys(BasePackage::$supportedLinkTypes) as $linkType) {
if ($this->validateArray($linkType) && isset($this->config[$linkType])) { if ($this->validateArray($linkType) && isset($this->config[$linkType])) {

@ -12,7 +12,7 @@
namespace Composer\Package; namespace Composer\Package;
use Composer\Package\Version\VersionParser; use Composer\Semver\VersionParser;
use Composer\Util\ComposerMirror; use Composer\Util\ComposerMirror;
/** /**

@ -15,6 +15,7 @@ namespace Composer\Package\Version;
use Composer\Config; use Composer\Config;
use Composer\Repository\Vcs\HgDriver; use Composer\Repository\Vcs\HgDriver;
use Composer\IO\NullIO; use Composer\IO\NullIO;
use Composer\Semver\VersionParser;
use Composer\Util\Git as GitUtil; use Composer\Util\Git as GitUtil;
use Composer\Util\ProcessExecutor; use Composer\Util\ProcessExecutor;
use Composer\Util\Svn as SvnUtil; use Composer\Util\Svn as SvnUtil;

@ -16,6 +16,7 @@ use Composer\DependencyResolver\Pool;
use Composer\Package\PackageInterface; use Composer\Package\PackageInterface;
use Composer\Package\Loader\ArrayLoader; use Composer\Package\Loader\ArrayLoader;
use Composer\Package\Dumper\ArrayDumper; use Composer\Package\Dumper\ArrayDumper;
use Composer\Semver\VersionParser;
/** /**
* Selects the best possible version for a package * Selects the best possible version for a package

@ -16,12 +16,12 @@ use Composer\Composer;
use Composer\EventDispatcher\EventSubscriberInterface; use Composer\EventDispatcher\EventSubscriberInterface;
use Composer\IO\IOInterface; use Composer\IO\IOInterface;
use Composer\Package\Package; use Composer\Package\Package;
use Composer\Package\Version\VersionParser; use Composer\Semver\VersionParser;
use Composer\Repository\RepositoryInterface; use Composer\Repository\RepositoryInterface;
use Composer\Package\AliasPackage; use Composer\Package\AliasPackage;
use Composer\Package\PackageInterface; use Composer\Package\PackageInterface;
use Composer\Package\Link; use Composer\Package\Link;
use Composer\Package\LinkConstraint\VersionConstraint; use Composer\Semver\Constraint\Constraint;
use Composer\DependencyResolver\Pool; use Composer\DependencyResolver\Pool;
/** /**
@ -131,7 +131,7 @@ class PluginManager
} }
$currentPluginApiVersion = $this->getPluginApiVersion(); $currentPluginApiVersion = $this->getPluginApiVersion();
$currentPluginApiConstraint = new VersionConstraint('==', $this->versionParser->normalize($currentPluginApiVersion)); $currentPluginApiConstraint = new Constraint('==', $this->versionParser->normalize($currentPluginApiVersion));
if (!$requiresComposer->matches($currentPluginApiConstraint)) { if (!$requiresComposer->matches($currentPluginApiConstraint)) {
$this->io->writeError('<warning>The "' . $package->getName() . '" plugin was skipped because it requires a Plugin API version ("' . $requiresComposer->getPrettyString() . '") that does not match your Composer installation ("' . $currentPluginApiVersion . '"). You may need to run composer update with the "--no-plugins" option.</warning>'); $this->io->writeError('<warning>The "' . $package->getName() . '" plugin was skipped because it requires a Plugin API version ("' . $requiresComposer->getPrettyString() . '") that does not match your Composer installation ("' . $currentPluginApiVersion . '"). You may need to run composer update with the "--no-plugins" option.</warning>');

@ -15,9 +15,9 @@ namespace Composer\Repository;
use Composer\Package\AliasPackage; use Composer\Package\AliasPackage;
use Composer\Package\PackageInterface; use Composer\Package\PackageInterface;
use Composer\Package\CompletePackageInterface; use Composer\Package\CompletePackageInterface;
use Composer\Package\Version\VersionParser; use Composer\Semver\VersionParser;
use Composer\Package\LinkConstraint\LinkConstraintInterface; use Composer\Semver\Constraint\ConstraintInterface;
use Composer\Package\LinkConstraint\VersionConstraint; use Composer\Semver\Constraint\Constraint;
/** /**
* A repository implementation that simply stores packages in an array * A repository implementation that simply stores packages in an array
@ -43,14 +43,14 @@ class ArrayRepository implements RepositoryInterface
{ {
$name = strtolower($name); $name = strtolower($name);
if (!$constraint instanceof LinkConstraintInterface) { if (!$constraint instanceof ConstraintInterface) {
$versionParser = new VersionParser(); $versionParser = new VersionParser();
$constraint = $versionParser->parseConstraints($constraint); $constraint = $versionParser->parseConstraints($constraint);
} }
foreach ($this->getPackages() as $package) { foreach ($this->getPackages() as $package) {
if ($name === $package->getName()) { if ($name === $package->getName()) {
$pkgConstraint = new VersionConstraint('==', $package->getVersion()); $pkgConstraint = new Constraint('==', $package->getVersion());
if ($constraint->matches($pkgConstraint)) { if ($constraint->matches($pkgConstraint)) {
return $package; return $package;
} }
@ -67,14 +67,14 @@ class ArrayRepository implements RepositoryInterface
$name = strtolower($name); $name = strtolower($name);
$packages = array(); $packages = array();
if (null !== $constraint && !$constraint instanceof LinkConstraintInterface) { if (null !== $constraint && !$constraint instanceof ConstraintInterface) {
$versionParser = new VersionParser(); $versionParser = new VersionParser();
$constraint = $versionParser->parseConstraints($constraint); $constraint = $versionParser->parseConstraints($constraint);
} }
foreach ($this->getPackages() as $package) { foreach ($this->getPackages() as $package) {
if ($name === $package->getName()) { if ($name === $package->getName()) {
$pkgConstraint = new VersionConstraint('==', $package->getVersion()); $pkgConstraint = new Constraint('==', $package->getVersion());
if (null === $constraint || $constraint->matches($pkgConstraint)) { if (null === $constraint || $constraint->matches($pkgConstraint)) {
$packages[] = $package; $packages[] = $package;
} }

@ -15,7 +15,7 @@ namespace Composer\Repository;
use Composer\Package\Loader\ArrayLoader; use Composer\Package\Loader\ArrayLoader;
use Composer\Package\PackageInterface; use Composer\Package\PackageInterface;
use Composer\Package\AliasPackage; use Composer\Package\AliasPackage;
use Composer\Package\Version\VersionParser; use Composer\Semver\VersionParser;
use Composer\DependencyResolver\Pool; use Composer\DependencyResolver\Pool;
use Composer\Json\JsonFile; use Composer\Json\JsonFile;
use Composer\Cache; use Composer\Cache;
@ -25,8 +25,8 @@ use Composer\Util\RemoteFilesystem;
use Composer\Plugin\PluginEvents; use Composer\Plugin\PluginEvents;
use Composer\Plugin\PreFileDownloadEvent; use Composer\Plugin\PreFileDownloadEvent;
use Composer\EventDispatcher\EventDispatcher; use Composer\EventDispatcher\EventDispatcher;
use Composer\Package\LinkConstraint\LinkConstraintInterface; use Composer\Semver\Constraint\ConstraintInterface;
use Composer\Package\LinkConstraint\VersionConstraint; use Composer\Semver\Constraint\Constraint;
/** /**
* @author Jordi Boggiano <j.boggiano@seld.be> * @author Jordi Boggiano <j.boggiano@seld.be>
@ -107,7 +107,7 @@ class ComposerRepository extends ArrayRepository
} }
$name = strtolower($name); $name = strtolower($name);
if (!$constraint instanceof LinkConstraintInterface) { if (!$constraint instanceof ConstraintInterface) {
$versionParser = new VersionParser(); $versionParser = new VersionParser();
$constraint = $versionParser->parseConstraints($constraint); $constraint = $versionParser->parseConstraints($constraint);
} }
@ -117,7 +117,7 @@ class ComposerRepository extends ArrayRepository
$packages = $this->whatProvides(new Pool('dev'), $providerName); $packages = $this->whatProvides(new Pool('dev'), $providerName);
foreach ($packages as $package) { foreach ($packages as $package) {
if ($name === $package->getName()) { if ($name === $package->getName()) {
$pkgConstraint = new VersionConstraint('==', $package->getVersion()); $pkgConstraint = new Constraint('==', $package->getVersion());
if ($constraint->matches($pkgConstraint)) { if ($constraint->matches($pkgConstraint)) {
return $package; return $package;
} }
@ -138,7 +138,7 @@ class ComposerRepository extends ArrayRepository
// normalize name // normalize name
$name = strtolower($name); $name = strtolower($name);
if (null !== $constraint && !$constraint instanceof LinkConstraintInterface) { if (null !== $constraint && !$constraint instanceof ConstraintInterface) {
$versionParser = new VersionParser(); $versionParser = new VersionParser();
$constraint = $versionParser->parseConstraints($constraint); $constraint = $versionParser->parseConstraints($constraint);
} }
@ -150,7 +150,7 @@ class ComposerRepository extends ArrayRepository
$candidates = $this->whatProvides(new Pool('dev'), $providerName); $candidates = $this->whatProvides(new Pool('dev'), $providerName);
foreach ($candidates as $package) { foreach ($candidates as $package) {
if ($name === $package->getName()) { if ($name === $package->getName()) {
$pkgConstraint = new VersionConstraint('==', $package->getVersion()); $pkgConstraint = new Constraint('==', $package->getVersion());
if (null === $constraint || $constraint->matches($pkgConstraint)) { if (null === $constraint || $constraint->matches($pkgConstraint)) {
$packages[] = $package; $packages[] = $package;
} }

@ -18,7 +18,7 @@ use Composer\Json\JsonFile;
use Composer\Package\Loader\ArrayLoader; use Composer\Package\Loader\ArrayLoader;
use Composer\Package\Loader\LoaderInterface; use Composer\Package\Loader\LoaderInterface;
use Composer\Package\Version\VersionGuesser; use Composer\Package\Version\VersionGuesser;
use Composer\Package\Version\VersionParser; use Composer\Semver\VersionParser;
use Composer\Util\ProcessExecutor; use Composer\Util\ProcessExecutor;
/** /**

@ -13,13 +13,13 @@
namespace Composer\Repository; namespace Composer\Repository;
use Composer\IO\IOInterface; use Composer\IO\IOInterface;
use Composer\Package\Version\VersionParser; use Composer\Semver\VersionParser;
use Composer\Repository\Pear\ChannelReader; use Composer\Repository\Pear\ChannelReader;
use Composer\Package\CompletePackage; use Composer\Package\CompletePackage;
use Composer\Repository\Pear\ChannelInfo; use Composer\Repository\Pear\ChannelInfo;
use Composer\EventDispatcher\EventDispatcher; use Composer\EventDispatcher\EventDispatcher;
use Composer\Package\Link; use Composer\Package\Link;
use Composer\Package\LinkConstraint\VersionConstraint; use Composer\Semver\Constraint\Constraint;
use Composer\Util\RemoteFilesystem; use Composer\Util\RemoteFilesystem;
use Composer\Config; use Composer\Config;
@ -120,7 +120,7 @@ class PearRepository extends ArrayRepository
// cause we've know only repository channel alias // cause we've know only repository channel alias
if ($channelInfo->getName() == $packageDefinition->getChannelName()) { if ($channelInfo->getName() == $packageDefinition->getChannelName()) {
$composerPackageAlias = $this->buildComposerPackageName($channelInfo->getAlias(), $packageDefinition->getPackageName()); $composerPackageAlias = $this->buildComposerPackageName($channelInfo->getAlias(), $packageDefinition->getPackageName());
$aliasConstraint = new VersionConstraint('==', $normalizedVersion); $aliasConstraint = new Constraint('==', $normalizedVersion);
$replaces[] = new Link($composerPackageName, $composerPackageAlias, $aliasConstraint, 'replaces', (string) $aliasConstraint); $replaces[] = new Link($composerPackageName, $composerPackageAlias, $aliasConstraint, 'replaces', (string) $aliasConstraint);
} }
@ -129,7 +129,7 @@ class PearRepository extends ArrayRepository
&& ($this->vendorAlias != 'pear-'.$channelInfo->getAlias() || $channelInfo->getName() != $packageDefinition->getChannelName()) && ($this->vendorAlias != 'pear-'.$channelInfo->getAlias() || $channelInfo->getName() != $packageDefinition->getChannelName())
) { ) {
$composerPackageAlias = "{$this->vendorAlias}/{$packageDefinition->getPackageName()}"; $composerPackageAlias = "{$this->vendorAlias}/{$packageDefinition->getPackageName()}";
$aliasConstraint = new VersionConstraint('==', $normalizedVersion); $aliasConstraint = new Constraint('==', $normalizedVersion);
$replaces[] = new Link($composerPackageName, $composerPackageAlias, $aliasConstraint, 'replaces', (string) $aliasConstraint); $replaces[] = new Link($composerPackageName, $composerPackageAlias, $aliasConstraint, 'replaces', (string) $aliasConstraint);
} }

@ -15,7 +15,7 @@ namespace Composer\Repository;
use Composer\Config; use Composer\Config;
use Composer\Package\PackageInterface; use Composer\Package\PackageInterface;
use Composer\Package\CompletePackage; use Composer\Package\CompletePackage;
use Composer\Package\Version\VersionParser; use Composer\Semver\VersionParser;
use Composer\Plugin\PluginInterface; use Composer\Plugin\PluginInterface;
/** /**

@ -38,8 +38,8 @@ interface RepositoryInterface extends \Countable
/** /**
* Searches for the first match of a package by name and version. * Searches for the first match of a package by name and version.
* *
* @param string $name package name * @param string $name package name
* @param string|\Composer\Package\LinkConstraint\LinkConstraintInterface $constraint package version or version constraint to match against * @param string|\Composer\Semver\Constraint\ConstraintInterface $constraint package version or version constraint to match against
* *
* @return PackageInterface|null * @return PackageInterface|null
*/ */
@ -48,8 +48,8 @@ interface RepositoryInterface extends \Countable
/** /**
* Searches for all packages matching a name and optionally a version. * Searches for all packages matching a name and optionally a version.
* *
* @param string $name package name * @param string $name package name
* @param string|\Composer\Package\LinkConstraint\LinkConstraintInterface $constraint package version or version constraint to match against * @param string|\Composer\Semver\Constraint\ConstraintInterface $constraint package version or version constraint to match against
* *
* @return array * @return array
*/ */

@ -43,8 +43,8 @@ class RepositoryManager
/** /**
* Searches for a package by it's name and version in managed repositories. * Searches for a package by it's name and version in managed repositories.
* *
* @param string $name package name * @param string $name package name
* @param string|\Composer\Package\LinkConstraint\LinkConstraintInterface $constraint package version or version constraint to match against * @param string|\Composer\Semver\Constraint\ConstraintInterface $constraint package version or version constraint to match against
* *
* @return PackageInterface|null * @return PackageInterface|null
*/ */
@ -60,8 +60,8 @@ class RepositoryManager
/** /**
* Searches for all packages matching a name and optionally a version in managed repositories. * Searches for all packages matching a name and optionally a version in managed repositories.
* *
* @param string $name package name * @param string $name package name
* @param string|\Composer\Package\LinkConstraint\LinkConstraintInterface $constraint package version or version constraint to match against * @param string|\Composer\Semver\Constraint\ConstraintInterface $constraint package version or version constraint to match against
* *
* @return array * @return array
*/ */

@ -14,7 +14,7 @@ namespace Composer\Repository;
use Composer\Downloader\TransportException; use Composer\Downloader\TransportException;
use Composer\Repository\Vcs\VcsDriverInterface; use Composer\Repository\Vcs\VcsDriverInterface;
use Composer\Package\Version\VersionParser; use Composer\Semver\VersionParser;
use Composer\Package\Loader\ArrayLoader; use Composer\Package\Loader\ArrayLoader;
use Composer\Package\Loader\ValidatingArrayLoader; use Composer\Package\Loader\ValidatingArrayLoader;
use Composer\Package\Loader\InvalidPackageException; use Composer\Package\Loader\InvalidPackageException;

@ -18,7 +18,7 @@ use Composer\DependencyResolver\DefaultPolicy;
use Composer\DependencyResolver\Pool; use Composer\DependencyResolver\Pool;
use Composer\Package\Link; use Composer\Package\Link;
use Composer\Package\AliasPackage; use Composer\Package\AliasPackage;
use Composer\Package\LinkConstraint\VersionConstraint; use Composer\Semver\Constraint\Constraint;
use Composer\TestCase; use Composer\TestCase;
class DefaultPolicyTest extends TestCase class DefaultPolicyTest extends TestCase
@ -158,7 +158,7 @@ class DefaultPolicyTest extends TestCase
$this->pool->addRepository($this->repoImportant); $this->pool->addRepository($this->repoImportant);
$this->pool->addRepository($this->repo); $this->pool->addRepository($this->repo);
$packages = $this->pool->whatProvides('a', new VersionConstraint('=', '2.1.9999999.9999999-dev')); $packages = $this->pool->whatProvides('a', new Constraint('=', '2.1.9999999.9999999-dev'));
$literals = array(); $literals = array();
foreach ($packages as $package) { foreach ($packages as $package) {
$literals[] = $package->getId(); $literals[] = $package->getId();
@ -176,8 +176,8 @@ class DefaultPolicyTest extends TestCase
$this->repo->addPackage($packageA = $this->getPackage('A', '1.0')); $this->repo->addPackage($packageA = $this->getPackage('A', '1.0'));
$this->repo->addPackage($packageB = $this->getPackage('B', '2.0')); $this->repo->addPackage($packageB = $this->getPackage('B', '2.0'));
$packageA->setProvides(array(new Link('A', 'X', new VersionConstraint('==', '1.0'), 'provides'))); $packageA->setProvides(array(new Link('A', 'X', new Constraint('==', '1.0'), 'provides')));
$packageB->setProvides(array(new Link('B', 'X', new VersionConstraint('==', '1.0'), 'provides'))); $packageB->setProvides(array(new Link('B', 'X', new Constraint('==', '1.0'), 'provides')));
$this->pool->addRepository($this->repo); $this->pool->addRepository($this->repo);
@ -194,7 +194,7 @@ class DefaultPolicyTest extends TestCase
$this->repo->addPackage($packageA = $this->getPackage('A', '1.0')); $this->repo->addPackage($packageA = $this->getPackage('A', '1.0'));
$this->repo->addPackage($packageB = $this->getPackage('B', '2.0')); $this->repo->addPackage($packageB = $this->getPackage('B', '2.0'));
$packageB->setReplaces(array(new Link('B', 'A', new VersionConstraint('==', '1.0'), 'replaces'))); $packageB->setReplaces(array(new Link('B', 'A', new Constraint('==', '1.0'), 'replaces')));
$this->pool->addRepository($this->repo); $this->pool->addRepository($this->repo);
@ -212,8 +212,8 @@ class DefaultPolicyTest extends TestCase
$this->repo->addPackage($packageB = $this->getPackage('vendor-b/replacer', '1.0')); $this->repo->addPackage($packageB = $this->getPackage('vendor-b/replacer', '1.0'));
$this->repo->addPackage($packageA = $this->getPackage('vendor-a/replacer', '1.0')); $this->repo->addPackage($packageA = $this->getPackage('vendor-a/replacer', '1.0'));
$packageA->setReplaces(array(new Link('vendor-a/replacer', 'vendor-a/package', new VersionConstraint('==', '1.0'), 'replaces'))); $packageA->setReplaces(array(new Link('vendor-a/replacer', 'vendor-a/package', new Constraint('==', '1.0'), 'replaces')));
$packageB->setReplaces(array(new Link('vendor-b/replacer', 'vendor-a/package', new VersionConstraint('==', '1.0'), 'replaces'))); $packageB->setReplaces(array(new Link('vendor-b/replacer', 'vendor-a/package', new Constraint('==', '1.0'), 'replaces')));
$this->pool->addRepository($this->repo); $this->pool->addRepository($this->repo);

@ -19,7 +19,7 @@ use Composer\DependencyResolver\Solver;
use Composer\DependencyResolver\SolverProblemsException; use Composer\DependencyResolver\SolverProblemsException;
use Composer\Package\Link; use Composer\Package\Link;
use Composer\TestCase; use Composer\TestCase;
use Composer\Package\LinkConstraint\MultiConstraint; use Composer\Semver\Constraint\MultiConstraint;
class SolverTest extends TestCase class SolverTest extends TestCase
{ {

@ -13,7 +13,7 @@
namespace Composer\Test\Package; namespace Composer\Test\Package;
use Composer\Package\Package; use Composer\Package\Package;
use Composer\Package\Version\VersionParser; use Composer\Semver\VersionParser;
use Composer\TestCase; use Composer\TestCase;
class CompletePackageTest extends TestCase class CompletePackageTest extends TestCase

@ -14,7 +14,7 @@ namespace Composer\Test\Package\Dumper;
use Composer\Package\Dumper\ArrayDumper; use Composer\Package\Dumper\ArrayDumper;
use Composer\Package\Link; use Composer\Package\Link;
use Composer\Package\LinkConstraint\VersionConstraint; use Composer\Semver\Constraint\Constraint;
class ArrayDumperTest extends \PHPUnit_Framework_TestCase class ArrayDumperTest extends \PHPUnit_Framework_TestCase
{ {
@ -161,13 +161,13 @@ class ArrayDumperTest extends \PHPUnit_Framework_TestCase
), ),
array( array(
'require', 'require',
array(new Link('foo', 'foo/bar', new VersionConstraint('=', '1.0.0.0'), 'requires', '1.0.0')), array(new Link('foo', 'foo/bar', new Constraint('=', '1.0.0.0'), 'requires', '1.0.0')),
'requires', 'requires',
array('foo/bar' => '1.0.0'), array('foo/bar' => '1.0.0'),
), ),
array( array(
'require-dev', 'require-dev',
array(new Link('foo', 'foo/bar', new VersionConstraint('=', '1.0.0.0'), 'requires (for development)', '1.0.0')), array(new Link('foo', 'foo/bar', new Constraint('=', '1.0.0.0'), 'requires (for development)', '1.0.0')),
'devRequires', 'devRequires',
array('foo/bar' => '1.0.0'), array('foo/bar' => '1.0.0'),
), ),
@ -182,13 +182,13 @@ class ArrayDumperTest extends \PHPUnit_Framework_TestCase
), ),
array( array(
'require', 'require',
array(new Link('foo', 'foo/bar', new VersionConstraint('=', '1.0.0.0'), 'requires', '1.0.0'), new Link('bar', 'bar/baz', new VersionConstraint('=', '1.0.0.0'), 'requires', '1.0.0')), array(new Link('foo', 'foo/bar', new Constraint('=', '1.0.0.0'), 'requires', '1.0.0'), new Link('bar', 'bar/baz', new Constraint('=', '1.0.0.0'), 'requires', '1.0.0')),
'requires', 'requires',
array('bar/baz' => '1.0.0', 'foo/bar' => '1.0.0') array('bar/baz' => '1.0.0', 'foo/bar' => '1.0.0')
), ),
array( array(
'require-dev', 'require-dev',
array(new Link('foo', 'foo/bar', new VersionConstraint('=', '1.0.0.0'), 'requires', '1.0.0'), new Link('bar', 'bar/baz', new VersionConstraint('=', '1.0.0.0'), 'requires', '1.0.0')), array(new Link('foo', 'foo/bar', new Constraint('=', '1.0.0.0'), 'requires', '1.0.0'), new Link('bar', 'bar/baz', new Constraint('=', '1.0.0.0'), 'requires', '1.0.0')),
'devRequires', 'devRequires',
array('bar/baz' => '1.0.0', 'foo/bar' => '1.0.0') array('bar/baz' => '1.0.0', 'foo/bar' => '1.0.0')
), ),
@ -200,19 +200,19 @@ class ArrayDumperTest extends \PHPUnit_Framework_TestCase
), ),
array( array(
'provide', 'provide',
array(new Link('foo', 'foo/bar', new VersionConstraint('=', '1.0.0.0'), 'requires', '1.0.0'), new Link('bar', 'bar/baz', new VersionConstraint('=', '1.0.0.0'), 'requires', '1.0.0')), array(new Link('foo', 'foo/bar', new Constraint('=', '1.0.0.0'), 'requires', '1.0.0'), new Link('bar', 'bar/baz', new Constraint('=', '1.0.0.0'), 'requires', '1.0.0')),
'provides', 'provides',
array('bar/baz' => '1.0.0', 'foo/bar' => '1.0.0') array('bar/baz' => '1.0.0', 'foo/bar' => '1.0.0')
), ),
array( array(
'replace', 'replace',
array(new Link('foo', 'foo/bar', new VersionConstraint('=', '1.0.0.0'), 'requires', '1.0.0'), new Link('bar', 'bar/baz', new VersionConstraint('=', '1.0.0.0'), 'requires', '1.0.0')), array(new Link('foo', 'foo/bar', new Constraint('=', '1.0.0.0'), 'requires', '1.0.0'), new Link('bar', 'bar/baz', new Constraint('=', '1.0.0.0'), 'requires', '1.0.0')),
'replaces', 'replaces',
array('bar/baz' => '1.0.0', 'foo/bar' => '1.0.0') array('bar/baz' => '1.0.0', 'foo/bar' => '1.0.0')
), ),
array( array(
'conflict', 'conflict',
array(new Link('foo', 'foo/bar', new VersionConstraint('=', '1.0.0.0'), 'requires', '1.0.0'), new Link('bar', 'bar/baz', new VersionConstraint('=', '1.0.0.0'), 'requires', '1.0.0')), array(new Link('foo', 'foo/bar', new Constraint('=', '1.0.0.0'), 'requires', '1.0.0'), new Link('bar', 'bar/baz', new Constraint('=', '1.0.0.0'), 'requires', '1.0.0')),
'conflicts', 'conflicts',
array('bar/baz' => '1.0.0', 'foo/bar' => '1.0.0') array('bar/baz' => '1.0.0', 'foo/bar' => '1.0.0')
), ),

@ -16,7 +16,7 @@ use Composer\Config;
use Composer\Package\Loader\RootPackageLoader; use Composer\Package\Loader\RootPackageLoader;
use Composer\Package\BasePackage; use Composer\Package\BasePackage;
use Composer\Package\Version\VersionGuesser; use Composer\Package\Version\VersionGuesser;
use Composer\Package\Version\VersionParser; use Composer\Semver\VersionParser;
class RootPackageLoaderTest extends \PHPUnit_Framework_TestCase class RootPackageLoaderTest extends \PHPUnit_Framework_TestCase
{ {

@ -14,7 +14,7 @@ namespace Composer\Test\Package\Version;
use Composer\Config; use Composer\Config;
use Composer\Package\Version\VersionGuesser; use Composer\Package\Version\VersionGuesser;
use Composer\Package\Version\VersionParser; use Composer\Semver\VersionParser;
class VersionGuesserTest extends \PHPUnit_Framework_TestCase class VersionGuesserTest extends \PHPUnit_Framework_TestCase
{ {

@ -13,7 +13,7 @@
namespace Composer\Test\Package\Version; namespace Composer\Test\Package\Version;
use Composer\Package\Version\VersionSelector; use Composer\Package\Version\VersionSelector;
use Composer\Package\Version\VersionParser; use Composer\Semver\VersionParser;
class VersionSelectorTest extends \PHPUnit_Framework_TestCase class VersionSelectorTest extends \PHPUnit_Framework_TestCase
{ {

@ -16,7 +16,7 @@ use Composer\IO\NullIO;
use Composer\Test\Mock\FactoryMock; use Composer\Test\Mock\FactoryMock;
use Composer\TestCase; use Composer\TestCase;
use Composer\Package\Loader\ArrayLoader; use Composer\Package\Loader\ArrayLoader;
use Composer\Package\Version\VersionParser; use Composer\Semver\VersionParser;
class ComposerRepositoryTest extends TestCase class ComposerRepositoryTest extends TestCase
{ {

@ -13,7 +13,7 @@
namespace Composer\Repository; namespace Composer\Repository;
use Composer\Package\Loader\ArrayLoader; use Composer\Package\Loader\ArrayLoader;
use Composer\Package\Version\VersionParser; use Composer\Semver\VersionParser;
use Composer\TestCase; use Composer\TestCase;
use Composer\IO\NullIO; use Composer\IO\NullIO;
use Composer\Config; use Composer\Config;

@ -13,8 +13,8 @@
namespace Composer\Repository\Pear; namespace Composer\Repository\Pear;
use Composer\TestCase; use Composer\TestCase;
use Composer\Package\Version\VersionParser; use Composer\Semver\VersionParser;
use Composer\Package\LinkConstraint\VersionConstraint; use Composer\Semver\Constraint\Constraint;
use Composer\Package\Link; use Composer\Package\Link;
use Composer\Package\CompletePackage; use Composer\Package\CompletePackage;
use Composer\Test\Mock\RemoteFilesystemMock; use Composer\Test\Mock\RemoteFilesystemMock;
@ -135,7 +135,7 @@ class ChannelReaderTest extends TestCase
'*-ext-xml' => '*', '*-ext-xml' => '*',
)); ));
$expectedPackage->setReplaces(array( $expectedPackage->setReplaces(array(
new Link('pear-test.loc/sample', 'pear-test/sample', new VersionConstraint('==', '1.0.0.1'), 'replaces', '== 1.0.0.1'), new Link('pear-test.loc/sample', 'pear-test/sample', new Constraint('==', '1.0.0.1'), 'replaces', '== 1.0.0.1'),
)); ));
$this->assertCount(1, $packages); $this->assertCount(1, $packages);
@ -144,7 +144,7 @@ class ChannelReaderTest extends TestCase
private function createConstraint($operator, $version) private function createConstraint($operator, $version)
{ {
$constraint = new VersionConstraint($operator, $version); $constraint = new Constraint($operator, $version);
$constraint->setPrettyString($operator.' '.$version); $constraint->setPrettyString($operator.' '.$version);
return $constraint; return $constraint;

@ -12,9 +12,9 @@
namespace Composer; namespace Composer;
use Composer\Package\Version\VersionParser; use Composer\Semver\VersionParser;
use Composer\Package\AliasPackage; use Composer\Package\AliasPackage;
use Composer\Package\LinkConstraint\VersionConstraint; use Composer\Semver\Constraint\Constraint;
use Composer\Util\Filesystem; use Composer\Util\Filesystem;
abstract class TestCase extends \PHPUnit_Framework_TestCase abstract class TestCase extends \PHPUnit_Framework_TestCase
@ -32,7 +32,7 @@ abstract class TestCase extends \PHPUnit_Framework_TestCase
protected function getVersionConstraint($operator, $version) protected function getVersionConstraint($operator, $version)
{ {
$constraint = new VersionConstraint( $constraint = new Constraint(
$operator, $operator,
self::getVersionParser()->normalize($version) self::getVersionParser()->normalize($version)
); );

Loading…
Cancel
Save