class DefaultPolicy implements PolicyInterface (View source)

Methods

__construct($preferStable = false, $preferLowest = false)

No description

versionCompare(PackageInterface $a, PackageInterface $b, $operator)

No description

findUpdatePackages(Pool $pool, array $installedMap, PackageInterface $package, $mustMatchName = false)

No description

getPriority(Pool $pool, PackageInterface $package)

No description

selectPreferredPackages(Pool $pool, array $installedMap, array $literals, $requiredPackage = null)

No description

groupLiteralsByNamePreferInstalled(Pool $pool, array $installedMap, $literals)

No description

compareByPriorityPreferInstalled(Pool $pool, array $installedMap, PackageInterface $a, PackageInterface $b, $requiredPackage = null, $ignoreReplace = false)

No description

bool
replaces(PackageInterface $source, PackageInterface $target)

Checks if source replaces a package with the same name as target.

pruneToBestVersion(Pool $pool, $literals)

No description

pruneToHighestPriorityOrInstalled(Pool $pool, array $installedMap, array $literals)

Assumes that installed packages come first and then all highest priority packages

pruneRemoteAliases(Pool $pool, array $literals)

Assumes that locally aliased (in root package requires) packages take priority over branch-alias ones

Details

__construct($preferStable = false, $preferLowest = false)

Parameters

$preferStable
$preferLowest

versionCompare(PackageInterface $a, PackageInterface $b, $operator)

Parameters

PackageInterface $a
PackageInterface $b
$operator

findUpdatePackages(Pool $pool, array $installedMap, PackageInterface $package, $mustMatchName = false)

Parameters

Pool $pool
array $installedMap
PackageInterface $package
$mustMatchName

getPriority(Pool $pool, PackageInterface $package)

Parameters

Pool $pool
PackageInterface $package

selectPreferredPackages(Pool $pool, array $installedMap, array $literals, $requiredPackage = null)

Parameters

Pool $pool
array $installedMap
array $literals
$requiredPackage

protected groupLiteralsByNamePreferInstalled(Pool $pool, array $installedMap, $literals)

Parameters

Pool $pool
array $installedMap
$literals

compareByPriorityPreferInstalled(Pool $pool, array $installedMap, PackageInterface $a, PackageInterface $b, $requiredPackage = null, $ignoreReplace = false)

Parameters

Pool $pool
array $installedMap
PackageInterface $a
PackageInterface $b
$requiredPackage
$ignoreReplace

protected bool replaces(PackageInterface $source, PackageInterface $target)

Checks if source replaces a package with the same name as target.

Replace constraints are ignored. This method should only be used for prioritisation, not for actual constraint verification.

Parameters

PackageInterface $source
PackageInterface $target

Return Value

bool

protected pruneToBestVersion(Pool $pool, $literals)

Parameters

Pool $pool
$literals

protected pruneToHighestPriorityOrInstalled(Pool $pool, array $installedMap, array $literals)

Assumes that installed packages come first and then all highest priority packages

Parameters

Pool $pool
array $installedMap
array $literals

protected pruneRemoteAliases(Pool $pool, array $literals)

Assumes that locally aliased (in root package requires) packages take priority over branch-alias ones

If no package is a local alias, nothing happens

Parameters

Pool $pool
array $literals