class CompletePackage extends Package implements CompletePackageInterface (View source)

Package containing additional metadata that is not used by the solver

Constants

STABILITY_STABLE

STABILITY_RC

STABILITY_BETA

STABILITY_ALPHA

STABILITY_DEV

Properties

static $supportedLinkTypes from BasePackage
static $stabilities from BasePackage
int $id READ-ONLY: The package id, public for fast access in dependency solver from BasePackage
protected string $name from BasePackage
protected string $prettyName from BasePackage
protected RepositoryInterface $repository from BasePackage
protected array $transportOptions from BasePackage
protected $type from Package
protected $targetDir from Package
protected $installationSource from Package
protected $sourceType from Package
protected $sourceUrl from Package
protected $sourceReference from Package
protected $sourceMirrors from Package
protected $distType from Package
protected $distUrl from Package
protected $distReference from Package
protected $distSha1Checksum from Package
protected $distMirrors from Package
protected $version from Package
protected $prettyVersion from Package
protected $releaseDate from Package
protected $extra from Package
protected $binaries from Package
protected $dev from Package
protected $stability from Package
protected $notificationUrl from Package
protected Link[] $requires from Package
protected Link[] $conflicts from Package
protected Link[] $provides from Package
protected Link[] $replaces from Package
protected Link[] $devRequires from Package
protected $suggests from Package
protected $autoload from Package
protected $devAutoload from Package
protected $includePaths from Package
protected $archiveExcludes from Package
protected $repositories
protected $license
protected $keywords
protected $authors
protected $description
protected $homepage
protected $scripts
protected $support
protected $abandoned

Methods

__construct(string $name, string $version, string $prettyVersion)

Creates a new in memory package.

from Package
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

bool
isDev()

Returns whether the package is a development virtual package or a concrete one

from Package
setType(string $type)

No description

from Package
string
getType()

Returns the package type, e.g. library

from Package
string
getStability()

Returns the stability of this package: one of (dev, alpha, beta, RC, stable)

from Package
setTargetDir(string $targetDir)

No description

from Package
string
getTargetDir()

Returns the package targetDir property

from Package
setExtra(array $extra)

No description

from Package
array
getExtra()

Returns the package extra data

from Package
setBinaries(array $binaries)

No description

from Package
array
getBinaries()

Returns the package binaries

from Package
setInstallationSource(string $type)

Sets source from which this package was installed (source/dist).

from Package
string
getInstallationSource()

Returns source from which this package was installed (source/dist).

from Package
setSourceType(string $type)

No description

from Package
string
getSourceType()

Returns the repository type of this package, e.g. git, svn

from Package
setSourceUrl(string $url)

No description

from Package
string
getSourceUrl()

Returns the repository url of this package, e.g. git://github.com/naderman/composer.git

from Package
setSourceReference(string $reference)

No description

from Package
string
getSourceReference()

Returns the repository reference of this package, e.g. master, 1.0.0 or a commit hash for git

from Package
setSourceMirrors(array|null $mirrors)

No description

from Package
array|null
getSourceMirrors()

Returns the source mirrors of this package

from Package
array
getSourceUrls()

Returns the repository urls of this package including mirrors, e.g. git://github.com/naderman/composer.git

from Package
setDistType(string $type)

No description

from Package
string
getDistType()

Returns the type of the distribution archive of this version, e.g. zip, tarball

from Package
setDistUrl(string $url)

No description

from Package
string
getDistUrl()

Returns the url of the distribution archive of this version

from Package
setDistReference(string $reference)

No description

from Package
string
getDistReference()

Returns the reference of the distribution archive of this version, e.g. master, 1.0.0 or a commit hash for git

from Package
setDistSha1Checksum(string $sha1checksum)

No description

from Package
string
getDistSha1Checksum()

Returns the sha1 checksum for the distribution archive of this version

from Package
setDistMirrors(array|null $mirrors)

No description

from Package
array|null
getDistMirrors()

Returns the dist mirrors of this package

from Package
array
getDistUrls()

Returns the urls of the distribution archive of this version, including mirrors

from Package
string
getVersion()

Returns the version of this package

from Package
string
getPrettyVersion()

Returns the pretty (i.e. non-normalized) version string of this package

from Package
setReleaseDate(DateTime $releaseDate)

Set the releaseDate

from Package
getReleaseDate()

Returns the release date of the package

from Package
setRequires(array $requires)

Set the required packages

from Package
Link[]
getRequires()

Returns a set of links to packages which need to be installed before this package can be installed

from Package
setConflicts(array $conflicts)

Set the conflicting packages

from Package
Link[]
getConflicts()

Returns a set of links to packages which must not be installed at the same time as this package

from Package
setProvides(array $provides)

Set the provided virtual packages

from Package
Link[]
getProvides()

Returns a set of links to virtual packages that are provided through this package

from Package
setReplaces(array $replaces)

Set the packages this one replaces

from Package
Link[]
getReplaces()

Returns a set of links to packages which can alternatively be satisfied by installing this package

from Package
setDevRequires(array $devRequires)

Set the recommended packages

from Package
Link[]
getDevRequires()

Returns a set of links to packages which are required to develop this package. These are installed if in dev mode.

from Package
setSuggests(array $suggests)

Set the suggested packages

from Package
array
getSuggests()

Returns a set of package names and reasons why they are useful in combination with this package.

from Package
setAutoload(array $autoload)

Set the autoload mapping

from Package
array
getAutoload()

Returns an associative array of autoloading rules

from Package
setDevAutoload(array $devAutoload)

Set the dev autoload mapping

from Package
array
getDevAutoload()

Returns an associative array of dev autoloading rules

from Package
setIncludePaths(array $includePaths)

Sets the list of paths added to PHP's include path.

from Package
array
getIncludePaths()

Returns a list of directories which should get added to PHP's include path.

from Package
setNotificationUrl(string $notificationUrl)

Sets the notification URL

from Package
string
getNotificationUrl()

Returns the package notification url

from Package
setArchiveExcludes(array $excludes)

Sets a list of patterns to be excluded from archives

from Package
array
getArchiveExcludes()

Returns a list of patterns to exclude from package archives

from Package
replaceVersion(string $version, string $prettyVersion)

Replaces current version and pretty version with passed values.

from Package
getUrls($url, $mirrors, $ref, $type, $urlType)

No description

from Package
setScripts(array $scripts)

No description

array
getScripts()

Returns the scripts of this package

setRepositories(array $repositories)

Set the repositories

array
getRepositories()

Returns an array of repositories

setLicense(array $license)

Set the license

array
getLicense()

Returns the package license, e.g. MIT, BSD, GPL

setKeywords(array $keywords)

Set the keywords

array
getKeywords()

Returns an array of keywords relating to the package

setAuthors(array $authors)

Set the authors

array
getAuthors()

Returns an array of authors of the package

setDescription(string $description)

Set the description

string
getDescription()

Returns the package description

setHomepage(string $homepage)

Set the homepage

string
getHomepage()

Returns the package homepage

setSupport(array $support)

Set the support information

array
getSupport()

Returns the support information

bool
isAbandoned()

No description

setAbandoned(bool|string $abandoned)

No description

string
getReplacementPackage()

If the package is abandoned and has a suggested replacement, this method returns it

Details

__construct(string $name, string $version, string $prettyVersion)

Creates a new in memory package.

Parameters

string $name The package's name
string $version The package's version
string $prettyVersion The package's non-normalized version

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

bool isDev()

Returns whether the package is a development virtual package or a concrete one

Return Value

bool

setType(string $type)

Parameters

string $type

string getType()

Returns the package type, e.g. library

Return Value

string The package type

string getStability()

Returns the stability of this package: one of (dev, alpha, beta, RC, stable)

Return Value

string

setTargetDir(string $targetDir)

Parameters

string $targetDir

string getTargetDir()

Returns the package targetDir property

Return Value

string The package targetDir

setExtra(array $extra)

Parameters

array $extra

array getExtra()

Returns the package extra data

Return Value

array The package extra data

setBinaries(array $binaries)

Parameters

array $binaries

array getBinaries()

Returns the package binaries

Return Value

array

setInstallationSource(string $type)

Sets source from which this package was installed (source/dist).

Parameters

string $type source/dist

string getInstallationSource()

Returns source from which this package was installed (source/dist).

Return Value

string source/dist

setSourceType(string $type)

Parameters

string $type

string getSourceType()

Returns the repository type of this package, e.g. git, svn

Return Value

string The repository type

setSourceUrl(string $url)

Parameters

string $url

string getSourceUrl()

Returns the repository url of this package, e.g. git://github.com/naderman/composer.git

Return Value

string The repository url

setSourceReference(string $reference)

Parameters

string $reference

string getSourceReference()

Returns the repository reference of this package, e.g. master, 1.0.0 or a commit hash for git

Return Value

string The repository reference

setSourceMirrors(array|null $mirrors)

Parameters

array|null $mirrors

array|null getSourceMirrors()

Returns the source mirrors of this package

Return Value

array|null

array getSourceUrls()

Returns the repository urls of this package including mirrors, e.g. git://github.com/naderman/composer.git

Return Value

array

setDistType(string $type)

Parameters

string $type

string getDistType()

Returns the type of the distribution archive of this version, e.g. zip, tarball

Return Value

string The repository type

setDistUrl(string $url)

Parameters

string $url

string getDistUrl()

Returns the url of the distribution archive of this version

Return Value

string

setDistReference(string $reference)

Parameters

string $reference

string getDistReference()

Returns the reference of the distribution archive of this version, e.g. master, 1.0.0 or a commit hash for git

Return Value

string

setDistSha1Checksum(string $sha1checksum)

Parameters

string $sha1checksum

string getDistSha1Checksum()

Returns the sha1 checksum for the distribution archive of this version

Return Value

string

setDistMirrors(array|null $mirrors)

Parameters

array|null $mirrors

array|null getDistMirrors()

Returns the dist mirrors of this package

Return Value

array|null

array getDistUrls()

Returns the urls of the distribution archive of this version, including mirrors

Return Value

array

string getVersion()

Returns the version of this package

Return Value

string version

string getPrettyVersion()

Returns the pretty (i.e. non-normalized) version string of this package

Return Value

string version

setReleaseDate(DateTime $releaseDate)

Set the releaseDate

Parameters

DateTime $releaseDate

DateTime getReleaseDate()

Returns the release date of the package

Return Value

DateTime

setRequires(array $requires)

Set the required packages

Parameters

array $requires A set of package links

Link[] getRequires()

Returns a set of links to packages which need to be installed before this package can be installed

Return Value

Link[] An array of package links defining required packages

setConflicts(array $conflicts)

Set the conflicting packages

Parameters

array $conflicts A set of package links

Link[] getConflicts()

Returns a set of links to packages which must not be installed at the same time as this package

Return Value

Link[] An array of package links defining conflicting packages

setProvides(array $provides)

Set the provided virtual packages

Parameters

array $provides A set of package links

Link[] getProvides()

Returns a set of links to virtual packages that are provided through this package

Return Value

Link[] An array of package links defining provided packages

setReplaces(array $replaces)

Set the packages this one replaces

Parameters

array $replaces A set of package links

Link[] getReplaces()

Returns a set of links to packages which can alternatively be satisfied by installing this package

Return Value

Link[] An array of package links defining replaced packages

setDevRequires(array $devRequires)

Set the recommended packages

Parameters

array $devRequires A set of package links

Link[] getDevRequires()

Returns a set of links to packages which are required to develop this package. These are installed if in dev mode.

Return Value

Link[] An array of package links defining packages required for development

setSuggests(array $suggests)

Set the suggested packages

Parameters

array $suggests A set of package names/comments

array getSuggests()

Returns a set of package names and reasons why they are useful in combination with this package.

Return Value

array An array of package suggestions with descriptions

setAutoload(array $autoload)

Set the autoload mapping

Parameters

array $autoload Mapping of autoloading rules

array getAutoload()

Returns an associative array of autoloading rules

{"": {"<namespace": ""}}

Type is either "psr-4", "psr-0", "classmap" or "files". Namespaces are mapped to directories for autoloading using the type specified.

Return Value

array Mapping of autoloading rules

setDevAutoload(array $devAutoload)

Set the dev autoload mapping

Parameters

array $devAutoload Mapping of dev autoloading rules

array getDevAutoload()

Returns an associative array of dev autoloading rules

{"": {"<namespace": ""}}

Type is either "psr-4", "psr-0", "classmap" or "files". Namespaces are mapped to directories for autoloading using the type specified.

Return Value

array Mapping of dev autoloading rules

setIncludePaths(array $includePaths)

Sets the list of paths added to PHP's include path.

Parameters

array $includePaths List of directories.

array getIncludePaths()

Returns a list of directories which should get added to PHP's include path.

Return Value

array

setNotificationUrl(string $notificationUrl)

Sets the notification URL

Parameters

string $notificationUrl

string getNotificationUrl()

Returns the package notification url

Return Value

string

setArchiveExcludes(array $excludes)

Sets a list of patterns to be excluded from archives

Parameters

array $excludes

array getArchiveExcludes()

Returns a list of patterns to exclude from package archives

Return Value

array

replaceVersion(string $version, string $prettyVersion)

Replaces current version and pretty version with passed values.

It also sets stability.

Parameters

string $version The package's normalized version
string $prettyVersion The package's non-normalized version

protected getUrls($url, $mirrors, $ref, $type, $urlType)

Parameters

$url
$mirrors
$ref
$type
$urlType

setScripts(array $scripts)

Parameters

array $scripts

array getScripts()

Returns the scripts of this package

Return Value

array array('script name' => array('listeners'))

setRepositories(array $repositories)

Set the repositories

Parameters

array $repositories

array getRepositories()

Returns an array of repositories

{"": {}}

Return Value

array Repositories

setLicense(array $license)

Set the license

Parameters

array $license

array getLicense()

Returns the package license, e.g. MIT, BSD, GPL

Return Value

array The package licenses

setKeywords(array $keywords)

Set the keywords

Parameters

array $keywords

array getKeywords()

Returns an array of keywords relating to the package

Return Value

array

setAuthors(array $authors)

Set the authors

Parameters

array $authors

array getAuthors()

Returns an array of authors of the package

Each item can contain name/homepage/email keys

Return Value

array

setDescription(string $description)

Set the description

Parameters

string $description

string getDescription()

Returns the package description

Return Value

string

setHomepage(string $homepage)

Set the homepage

Parameters

string $homepage

string getHomepage()

Returns the package homepage

Return Value

string

setSupport(array $support)

Set the support information

Parameters

array $support

array getSupport()

Returns the support information

Return Value

array

bool isAbandoned()

Return Value

bool

setAbandoned(bool|string $abandoned)

Parameters

bool|string $abandoned

string getReplacementPackage()

If the package is abandoned and has a suggested replacement, this method returns it

Return Value

string