Composer API
Class

Composer\Package\BasePackage

abstract class BasePackage implements PackageInterface

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

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.

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

RepositoryInterface 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)

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()

__clone()

Details

at line 66
public __construct(string $name)

All descendants' constructors should call this parent constructor

Parameters

string $name The package's name

at line 76
public string getName()

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

Return Value

string package name

at line 84
public string getPrettyName()

Returns the package's pretty (i.e.

with proper case) name

Return Value

string package name

at line 92
public 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

at line 112
public setId(int $id)

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

Parameters

int $id

at line 120
public int getId()

Retrieves the package's id set through setId

Return Value

int The previously set package id

at line 128
public setRepository(RepositoryInterface $repository)

Stores a reference to the repository that owns the package

Parameters

RepositoryInterface $repository

at line 139
public RepositoryInterface getRepository()

Returns a reference to the repository that owns the package

Return Value

RepositoryInterface

at line 147
public array getTransportOptions()

Returns a list of options to download package dist files

Return Value

array

at line 157
public setTransportOptions(array $options)

Configures the list of options to download package dist files

Parameters

array $options

at line 167
public bool isPlatform()

checks if this package is a platform package

Return Value

bool

at line 177
public string getUniqueName()

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

Return Value

string

at line 182
public equals(PackageInterface $package)

Parameters

PackageInterface $package

at line 200
public string __toString()

Converts the package into a readable and unique string

Return Value

string

at line 205
public string getPrettyString()

Converts the package into a pretty readable string

Return Value

string

at line 213
public 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

at line 227
public getStabilityPriority()

at line 232
public __clone()