function ConstraintInterface::compile
Provides a compiled version of the constraint for the given operator The compiled version must be a PHP expression. Executor of compile version must provide 2 variables:
- $v = the string version to compare with
- $b = whether or not the version is a non-comparable branch (starts with "dev-")
@example return '!$b && version_compare($v, '1.0', '>')';
@phpstan-param Constraint::OP_* $otherOperator
Parameters
int $otherOperator one Constraint::OP_*:
Return value
string
See also
Constraint::OP_* for the list of available operators.
4 methods override ConstraintInterface::compile()
- Constraint::compile in vendor/
composer/ semver/ src/ Constraint/ Constraint.php - Provides a compiled version of the constraint for the given operator The compiled version must be a PHP expression. Executor of compile version must provide 2 variables:
- MatchAllConstraint::compile in vendor/
composer/ semver/ src/ Constraint/ MatchAllConstraint.php - Provides a compiled version of the constraint for the given operator The compiled version must be a PHP expression. Executor of compile version must provide 2 variables:
- MatchNoneConstraint::compile in vendor/
composer/ semver/ src/ Constraint/ MatchNoneConstraint.php - Provides a compiled version of the constraint for the given operator The compiled version must be a PHP expression. Executor of compile version must provide 2 variables:
- MultiConstraint::compile in vendor/
composer/ semver/ src/ Constraint/ MultiConstraint.php - Provides a compiled version of the constraint for the given operator The compiled version must be a PHP expression. Executor of compile version must provide 2 variables:
File
-
vendor/
composer/ semver/ src/ Constraint/ ConstraintInterface.php, line 47
Class
- ConstraintInterface
- DO NOT IMPLEMENT this interface. It is only meant for usage as a type hint in libraries relying on composer/semver but creating your own constraint class that implements this interface is not a supported use case and will cause the composer/semver…
Namespace
Composer\Semver\ConstraintCode
public function compile($otherOperator);