class RuleSetGenerator (View source)

Properties

protected $policy
protected $pool
protected $rules
protected $jobs
protected $installedMap
protected $whitelistedMap
protected $addedMap
protected $conflictAddedMap
protected $addedPackages
protected $addedPackagesByNames

Methods

__construct(PolicyInterface $policy, Pool $pool)

No description

createRequireRule(PackageInterface $package, array $providers, int $reason, mixed $reasonData = null)

Creates a new rule for the requirements of a package

createInstallOneOfRule(array $packages, int $reason, array $job)

Creates a rule to install at least one of a set of packages

createRemoveRule(PackageInterface $package, int $reason, array $job)

Creates a rule to remove a package

createRule2Literals(PackageInterface $issuer, PackageInterface $provider, int $reason, mixed $reasonData = null)

Creates a rule for two conflicting packages

whitelistFromPackage(PackageInterface $package)

No description

addRulesForPackage(PackageInterface $package, $ignorePlatformReqs)

No description

addConflictRules()

No description

obsoleteImpossibleForAlias($package, $provider)

No description

whitelistFromJobs()

No description

addRulesForJobs($ignorePlatformReqs)

No description

getRulesFor($jobs, $installedMap, $ignorePlatformReqs = false)

No description

Details

__construct(PolicyInterface $policy, Pool $pool)

Parameters

PolicyInterface $policy
Pool $pool

protected Rule createRequireRule(PackageInterface $package, array $providers, int $reason, mixed $reasonData = null)

Creates a new rule for the requirements of a package

This rule is of the form (-A|B|C), where B and C are the providers of one requirement of the package A.

Parameters

PackageInterface $package The package with a requirement
array $providers The providers of the requirement
int $reason A RULE_* constant describing the reason for generating this rule
mixed $reasonData Any data, e.g. the requirement name, that goes with the reason

Return Value

Rule The generated rule or null if tautological

protected Rule createInstallOneOfRule(array $packages, int $reason, array $job)

Creates a rule to install at least one of a set of packages

The rule is (A|B|C) with A, B and C different packages. If the given set of packages is empty an impossible rule is generated.

Parameters

array $packages The set of packages to choose from
int $reason A RULE_* constant describing the reason for generating this rule
array $job The job this rule was created from

Return Value

Rule The generated rule

protected Rule createRemoveRule(PackageInterface $package, int $reason, array $job)

Creates a rule to remove a package

The rule for a package A is (-A).

Parameters

PackageInterface $package The package to be removed
int $reason A RULE_* constant describing the reason for generating this rule
array $job The job this rule was created from

Return Value

Rule The generated rule

protected Rule createRule2Literals(PackageInterface $issuer, PackageInterface $provider, int $reason, mixed $reasonData = null)

Creates a rule for two conflicting packages

The rule for conflicting packages A and B is (-A|-B). A is called the issuer and B the provider.

Parameters

PackageInterface $issuer The package declaring the conflict
PackageInterface $provider The package causing the conflict
int $reason A RULE_* constant describing the reason for generating this rule
mixed $reasonData Any data, e.g. the package name, that goes with the reason

Return Value

Rule The generated rule

protected whitelistFromPackage(PackageInterface $package)

Parameters

PackageInterface $package

protected addRulesForPackage(PackageInterface $package, $ignorePlatformReqs)

Parameters

PackageInterface $package
$ignorePlatformReqs

protected addConflictRules()

protected obsoleteImpossibleForAlias($package, $provider)

Parameters

$package
$provider

protected whitelistFromJobs()

protected addRulesForJobs($ignorePlatformReqs)

Parameters

$ignorePlatformReqs

getRulesFor($jobs, $installedMap, $ignorePlatformReqs = false)

Parameters

$jobs
$installedMap
$ignorePlatformReqs