Update core 8.3.0

This commit is contained in:
Rob Davies 2017-04-13 15:53:35 +01:00
parent da7a7918f8
commit cd7a898e66
6144 changed files with 132297 additions and 87747 deletions

View file

@ -11,6 +11,8 @@
namespace Composer\Semver\Constraint;
trigger_error('The ' . __CLASS__ . ' abstract class is deprecated, there is no replacement for it, it will be removed in the next major version.', E_USER_DEPRECATED);
/**
* Base constraint class.
*/
@ -26,17 +28,13 @@ abstract class AbstractConstraint implements ConstraintInterface
*/
public function matches(ConstraintInterface $provider)
{
if ($provider instanceof MultiConstraint) {
// turn matching around to find a match
return $provider->matches($this);
}
if ($provider instanceof $this) {
// see note at bottom of this class declaration
return $this->matchSpecific($provider);
}
return true;
// turn matching around to find a match
return $provider->matches($this);
}
/**

View file

@ -14,7 +14,7 @@ namespace Composer\Semver\Constraint;
/**
* Defines a constraint.
*/
class Constraint extends AbstractConstraint
class Constraint implements ConstraintInterface
{
/* operator integer values */
const OP_EQ = 0;
@ -55,10 +55,48 @@ class Constraint extends AbstractConstraint
);
/** @var string */
private $operator;
protected $operator;
/** @var string */
private $version;
protected $version;
/** @var string */
protected $prettyString;
/**
* @param ConstraintInterface $provider
*
* @return bool
*/
public function matches(ConstraintInterface $provider)
{
if ($provider instanceof $this) {
return $this->matchSpecific($provider);
}
// turn matching around to find a match
return $provider->matches($this);
}
/**
* @param string $prettyString
*/
public function setPrettyString($prettyString)
{
$this->prettyString = $prettyString;
}
/**
* @return string
*/
public function getPrettyString()
{
if ($this->prettyString) {
return $this->prettyString;
}
return $this->__toString();
}
/**
* Get all supported comparison operators.

View file

@ -20,11 +20,6 @@ interface ConstraintInterface
*/
public function matches(ConstraintInterface $provider);
/**
* @param string $prettyString
*/
public function setPrettyString($prettyString);
/**
* @return string
*/

View file

@ -35,6 +35,30 @@ class MultiConstraint implements ConstraintInterface
$this->conjunctive = $conjunctive;
}
/**
* @return ConstraintInterface[]
*/
public function getConstraints()
{
return $this->constraints;
}
/**
* @return bool
*/
public function isConjunctive()
{
return $this->conjunctive;
}
/**
* @return bool
*/
public function isDisjunctive()
{
return !$this->conjunctive;
}
/**
* @param ConstraintInterface $provider
*