abstract class BasePackage implements PackageInterface (View source)

Base class for packages providing name storage and default match implementation

Constants

STABILITY_STABLE

STABILITY_RC

STABILITY_BETA

STABILITY_ALPHA

STABILITY_DEV

Properties

static $supportedLinkTypes
static $stabilities
int $id READ-ONLY: The package id, public for fast access in dependency solver
protected string $name
protected string $prettyName
protected RepositoryInterface $repository
protected array $transportOptions

Methods

__construct(string $name)

All descendants' constructors should call this parent constructor

string
getName()

Returns the package's name without version info, thus not a unique identifier

string
getPrettyName()

Returns the package's pretty (i.e. with proper case) name

array
getNames()

Returns a set of names that could refer to this package

setId(int $id)

Allows the solver to set an id for this package to refer to it.

int
getId()

Retrieves the package's id set through setId

setRepository(RepositoryInterface $repository)

Stores a reference to the repository that owns the package

getRepository()

Returns a reference to the repository that owns the package

array
getTransportOptions()

Returns a list of options to download package dist files

setTransportOptions(array $options)

Configures the list of options to download package dist files

bool
isPlatform()

checks if this package is a platform package

string
getUniqueName()

Returns package unique name, constructed from name, version and release type.

equals(PackageInterface $package)

No description

string
__toString()

Converts the package into a readable and unique string

string
getPrettyString()

Converts the package into a pretty readable string

string
getFullPrettyVersion(bool $truncate = true)

Returns the pretty version string plus a git or hg commit hash of this package

getStabilityPriority()

No description

__clone()

No description

Details

__construct(string $name)

All descendants' constructors should call this parent constructor

Parameters

string $name The package's name

string getName()

Returns the package's name without version info, thus not a unique identifier

Return Value

string package name

string getPrettyName()

Returns the package's pretty (i.e. with proper case) name

Return Value

string package name

array getNames()

Returns a set of names that could refer to this package

No version or release type information should be included in any of the names. Provided or replaced package names need to be returned as well.

Return Value

array An array of strings referring to this package

setId(int $id)

Allows the solver to set an id for this package to refer to it.

Parameters

int $id

int getId()

Retrieves the package's id set through setId

Return Value

int The previously set package id

setRepository(RepositoryInterface $repository)

Stores a reference to the repository that owns the package

Parameters

RepositoryInterface $repository

RepositoryInterface getRepository()

Returns a reference to the repository that owns the package

Return Value

RepositoryInterface

array getTransportOptions()

Returns a list of options to download package dist files

Return Value

array

setTransportOptions(array $options)

Configures the list of options to download package dist files

Parameters

array $options

bool isPlatform()

checks if this package is a platform package

Return Value

bool

string getUniqueName()

Returns package unique name, constructed from name, version and release type.

Return Value

string

equals(PackageInterface $package)

Parameters

PackageInterface $package

string __toString()

Converts the package into a readable and unique string

Return Value

string

string getPrettyString()

Converts the package into a pretty readable string

Return Value

string

string getFullPrettyVersion(bool $truncate = true)

Returns the pretty version string plus a git or hg commit hash of this package

Parameters

bool $truncate If the source reference is a sha1 hash, truncate it

Return Value

string version

getStabilityPriority()

__clone()