class Link (View source)

Represents a link between two packages, represented by their names

Properties

protected string $source
protected string $target
protected ConstraintInterface|null $constraint
protected string $description
protected string|null $prettyConstraint

Methods

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

Creates a new package link.

string
getDescription()

No description

string
getSource()

No description

string
getTarget()

No description

ConstraintInterface|null
getConstraint()

No description

string
getPrettyConstraint()

No description

string
__toString()

No description

string
getPrettyString(PackageInterface $sourcePackage)

No description

Details

__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

string getDescription()

Return Value

string

string getSource()

Return Value

string

string getTarget()

Return Value

string

ConstraintInterface|null getConstraint()

Return Value

ConstraintInterface|null

string getPrettyConstraint()

Return Value

string

Exceptions

UnexpectedValueException If no pretty constraint was provided

string __toString()

Return Value

string

string getPrettyString(PackageInterface $sourcePackage)

Parameters

PackageInterface $sourcePackage

Return Value

string