Skip to main content

Module version_selector

Module version_selector 

Source
Expand description

Port of Composer\Package\Version\VersionSelector (docs/reference/VersionSelector.php): the best candidate for a name (preferred stability, then descending version, filtered by platform requirements) and the recommended constraint for require (^x.y, @stability, branch alias).

Collecting the candidates (RepositorySet::findPackages) is left to the caller: find_best_candidate receives already loaded indices.

Structs§

Warning
A Cannot use ... warning; verbose means IOInterface::VERBOSE (a repeat for the same package/target pair, hidden in normal mode).

Functions§

find_best_candidate
findBestCandidate on already found candidates: sort by preferred stability then version, platform filter, a 9999999-dev alias returned as its base package. Warnings are returned in order.
find_recommended_require_version
findRecommendedRequireVersion; php_version is the local PHP’s PHP_MAJOR.MINOR.RELEASE (for the ext-* rule).
platform_constraints
$this->platformConstraints: name -> [Constraint('==', version)] of the PlatformRepository packages.