Composer API
Class

Composer\Package\Link

class Link

Represents a link between two packages, represented by their names

Methods

__construct(string $source, string $target, ConstraintInterface $constraint = null, string $description = 'relates to', string|null $prettyConstraint = null)

Creates a new package link.

string getDescription()

string getSource()

string getTarget()

ConstraintInterface|null getConstraint()

string getPrettyConstraint()

string __toString()

string getPrettyString(PackageInterface $sourcePackage)

Details

at line 58
public __construct(string $source, string $target, ConstraintInterface $constraint = null, string $description = 'relates to', string|null $prettyConstraint = null)

Creates a new package link.

Parameters

string $source
string $target
ConstraintInterface $constraint Constraint applying to the target of this link
string $description Used to create a descriptive string representation
string|null $prettyConstraint

at line 70
public string getDescription()

Return Value

string

at line 78
public string getSource()

Return Value

string

at line 86
public string getTarget()

Return Value

string

at line 94
public ConstraintInterface|null getConstraint()

Return Value

ConstraintInterface|null

at line 103
public string getPrettyConstraint()

Return Value

string

Exceptions

UnexpectedValueException If no pretty constraint was provided

at line 115
public string __toString()

Return Value

string

at line 124
public string getPrettyString(PackageInterface $sourcePackage)

Parameters

PackageInterface $sourcePackage

Return Value

string