public function Constraint::__construct in Zircon Profile 8
Same name in this branch
- 8 vendor/symfony/validator/Constraint.php \Symfony\Component\Validator\Constraint::__construct()
- 8 vendor/composer/semver/src/Constraint/Constraint.php \Composer\Semver\Constraint\Constraint::__construct()
Same name and namespace in other branches
- 8.0 vendor/composer/semver/src/Constraint/Constraint.php \Composer\Semver\Constraint\Constraint::__construct()
Sets operator and version to compare with.
Parameters
string $operator:
string $version:
Throws
\InvalidArgumentException if invalid operator is given.
File
- vendor/
composer/ semver/ src/ Constraint/ Constraint.php, line 81
Class
- Constraint
- Defines a constraint.
Namespace
Composer\Semver\ConstraintCode
public function __construct($operator, $version) {
if (!isset(self::$transOpStr[$operator])) {
throw new \InvalidArgumentException(sprintf('Invalid operator "%s" given, expected one of: %s', $operator, implode(', ', self::getSupportedOperators())));
}
$this->operator = self::$transOpStr[$operator];
$this->version = $version;
}