### Install composer/semver Source: https://github.com/composer/semver/blob/main/README.md Installs the latest version of the composer/semver library using Composer. ```bash composer require composer/semver ``` -------------------------------- ### Composer Semver Intervals Methods Source: https://github.com/composer/semver/blob/main/README.md Provides static utility methods for working with version intervals and complex constraints. ```APIDOC Composer\Semver\Intervals: isSubsetOf(ConstraintInterface $candidate, ConstraintInterface $constraint): bool Checks if the candidate constraint is a subset of the given constraint. haveIntersections(ConstraintInterface $a, ConstraintInterface $b): bool Checks if two constraints have any intersection. Equivalent to $a->matches($b). compactConstraint(ConstraintInterface $constraint): ConstraintInterface Optimizes a complex multi-constraint by merging intervals. Note: This operation can be slow and may remove human-readable prettyConstraint information. get(ConstraintInterface $constraint): array Converts a constraint into an array of numeric intervals and branch constraints. clear(): void Clears the internal memoization cache for constraints. ``` -------------------------------- ### Composer Semver Methods Source: https://github.com/composer/semver/blob/main/README.md Provides methods for checking version satisfaction against constraints and sorting version arrays. ```APIDOC Composer\Semver\Semver: satisfies(string $version, string $constraints): bool Checks if a given version satisfies the specified constraints. satisfiedBy(array $versions, string $constraint): array Filters an array of versions, returning only those that satisfy the constraint. sort(array $versions): array Sorts an array of version strings in ascending order. rsort(array $versions): array Sorts an array of version strings in descending order. ``` -------------------------------- ### Composer Semver Comparator Methods Source: https://github.com/composer/semver/blob/main/README.md Provides static methods for comparing two version strings. Each method returns a boolean indicating the result of the comparison. ```APIDOC Composer\Semver\Comparator: greaterThan(string $v1, string $v2): bool Compares if $v1 is greater than $v2. greaterThanOrEqualTo(string $v1, string $v2): bool Compares if $v1 is greater than or equal to $v2. lessThan(string $v1, string $v2): bool Compares if $v1 is less than $v2. lessThanOrEqualTo(string $v1, string $v2): bool Compares if $v1 is less than or equal to $v2. equalTo(string $v1, string $v2): bool Compares if $v1 is equal to $v2. notEqualTo(string $v1, string $v2): bool Compares if $v1 is not equal to $v2. Example: Comparator::greaterThan('1.25.0', '1.24.0'); // Returns true ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.