function MultiConstraint::__construct
Parameters
ConstraintInterface[] $constraints A set of constraints:
bool $conjunctive Whether the constraints should be treated as conjunctive or disjunctive:
Throws
\InvalidArgumentException If less than 2 constraints are passed
File
-
vendor/
composer/ semver/ src/ Constraint/ MultiConstraint.php, line 46
Class
- MultiConstraint
- Defines a conjunctive or disjunctive set of constraints.
Namespace
Composer\Semver\ConstraintCode
public function __construct(array $constraints, $conjunctive = true) {
if (\count($constraints) < 2) {
throw new \InvalidArgumentException('Must provide at least two constraints for a MultiConstraint. Use ' . 'the regular Constraint class for one constraint only or MatchAllConstraint for none. You may use ' . 'MultiConstraint::create() which optimizes and handles those cases automatically.');
}
$this->constraints = $constraints;
$this->conjunctive = $conjunctive;
}