interface ConstraintInterface
Same name in this branch
- 11.1.x vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/ConstraintInterface.php \JsonSchema\Constraints\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 components to return unexpected results.
Hierarchy
- interface \Composer\Semver\Constraint\ConstraintInterface
Expanded class hierarchy of ConstraintInterface
All classes that implement ConstraintInterface
27 files declare their use of ConstraintInterface
- AdvisoryProviderInterface.php in vendor/
composer/ composer/ src/ Composer/ Repository/ AdvisoryProviderInterface.php - ArrayRepository.php in vendor/
composer/ composer/ src/ Composer/ Repository/ ArrayRepository.php - CompilingMatcher.php in vendor/
composer/ semver/ src/ CompilingMatcher.php - ComposerRepository.php in vendor/
composer/ composer/ src/ Composer/ Repository/ ComposerRepository.php - IgnoredSecurityAdvisory.php in vendor/
composer/ composer/ src/ Composer/ Advisory/ IgnoredSecurityAdvisory.php
File
-
vendor/
composer/ semver/ src/ Constraint/ ConstraintInterface.php, line 20
Namespace
Composer\Semver\ConstraintView source
interface ConstraintInterface {
/**
* Checks whether the given constraint intersects in any way with this constraint
*
* @param ConstraintInterface $provider
*
* @return bool
*/
public function matches(ConstraintInterface $provider);
/**
* 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-")
*
* @see Constraint::OP_* for the list of available operators.
* @example return '!$b && version_compare($v, '1.0', '>')';
*
* @param int $otherOperator one Constraint::OP_*
*
* @return string
*
* @phpstan-param Constraint::OP_* $otherOperator
*/
public function compile($otherOperator);
/**
* @return Bound
*/
public function getUpperBound();
/**
* @return Bound
*/
public function getLowerBound();
/**
* @return string
*/
public function getPrettyString();
/**
* @param string|null $prettyString
*
* @return void
*/
public function setPrettyString($prettyString);
/**
* @return string
*/
public function __toString();
}
Members
Title Sort descending | Modifiers | Object type | Summary | Overrides |
---|---|---|---|---|
ConstraintInterface::compile | public | function | 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: |
4 |
ConstraintInterface::getLowerBound | public | function | 4 | |
ConstraintInterface::getPrettyString | public | function | 4 | |
ConstraintInterface::getUpperBound | public | function | 4 | |
ConstraintInterface::matches | public | function | Checks whether the given constraint intersects in any way with this constraint | 4 |
ConstraintInterface::setPrettyString | public | function | 4 | |
ConstraintInterface::__toString | public | function | 4 |