InstalledVersions::satisfies( ComposerSemverVersionParser $parser, string $packageName, string|null $constraint )
Checks whether the given package satisfies a version constraint
Contents
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')
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
Return Return
(bool)
Source Source
File: vendor/composer/InstalledVersions.php
Expand full source code Collapse full source code View on Github