InstalledVersions::satisfies( ComposerSemverVersionParser $parser, string $packageName, string|null $constraint )

Checks whether the given package satisfies a version constraint


Description Description

e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call:

Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3')


Top ↑

Parameters Parameters

$parser

(Required) Install composer/semver to have access to this class and functionality

$packageName

(Required)

$constraint

(Required) A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package


Top ↑

Return Return

(bool)


Top ↑

Source Source

File: vendor/composer/InstalledVersions.php