Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Semver.php

function Semver::satisfies

Determine if given version satisfies given constraints.

Parameters

string $version:

string $constraints:

Return value

bool

10 calls to Semver::satisfies()
AnnounceFetcher::isRelevantItem in core/modules/announcements_feed/src/AnnounceFetcher.php
Check whether the version given is relevant to the Drupal version used.
ComposerInspector::validateExecutable in core/modules/package_manager/src/ComposerInspector.php
Validates that the Composer executable exists in a supported version.
ComposerMinimumStabilityValidator::validate in core/modules/package_manager/src/Validator/ComposerMinimumStabilityValidator.php
Validates composer minimum stability.
ComposerPatchesValidator::computePatcherStatus in core/modules/package_manager/src/Validator/ComposerPatchesValidator.php
Computes the status of the patcher plugin in a particular directory.
ComposerPluginsValidator::validate in core/modules/package_manager/src/Validator/ComposerPluginsValidator.php
Validates the allowed Composer plugins, both in active and stage.

... See full list

File

vendor/composer/semver/src/Semver.php, line 32

Class

Semver

Namespace

Composer\Semver

Code

public static function satisfies($version, $constraints) {
    if (null === self::$versionParser) {
        self::$versionParser = new VersionParser();
    }
    $versionParser = self::$versionParser;
    $provider = new Constraint('==', $versionParser->normalize($version));
    $parsedConstraints = $versionParser->parseConstraints($constraints);
    return $parsedConstraints->matches($provider);
}
RSS feed
Powered by Drupal