Composer API
Interface

Composer\Package\CompletePackageInterface

interface CompletePackageInterface implements PackageInterface

Defines package metadata that is not necessarily needed for solving and installing packages

Methods

string getName()

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

from PackageInterface
string getPrettyName()

Returns the package's pretty (i.e.

from PackageInterface
array getNames()

Returns a set of names that could refer to this package

from PackageInterface
setId(int $id)

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

from PackageInterface
int getId()

Retrieves the package's id set through setId

from PackageInterface
bool isDev()

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

from PackageInterface
string getType()

Returns the package type, e.g.

from PackageInterface
string getTargetDir()

Returns the package targetDir property

from PackageInterface
array getExtra()

Returns the package extra data

from PackageInterface
setInstallationSource(string $type)

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

from PackageInterface
string getInstallationSource()

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

from PackageInterface
string getSourceType()

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

from PackageInterface
string getSourceUrl()

Returns the repository url of this package, e.g.

from PackageInterface
array getSourceUrls()

Returns the repository urls of this package including mirrors, e.g.

from PackageInterface
string getSourceReference()

Returns the repository reference of this package, e.g.

from PackageInterface
array|null getSourceMirrors()

Returns the source mirrors of this package

from PackageInterface
string getDistType()

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

from PackageInterface
string getDistUrl()

Returns the url of the distribution archive of this version

from PackageInterface
array getDistUrls()

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

from PackageInterface
string getDistReference()

Returns the reference of the distribution archive of this version, e.g.

from PackageInterface
string getDistSha1Checksum()

Returns the sha1 checksum for the distribution archive of this version

from PackageInterface
array|null getDistMirrors()

Returns the dist mirrors of this package

from PackageInterface
string getVersion()

Returns the version of this package

from PackageInterface
string getPrettyVersion()

Returns the pretty (i.e.

from PackageInterface
string getFullPrettyVersion(bool $truncate = true)

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

from PackageInterface
DateTime getReleaseDate()

Returns the release date of the package

from PackageInterface
string getStability()

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

from PackageInterface
array getRequires()

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

from PackageInterface
array getConflicts()

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

from PackageInterface
array getProvides()

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

from PackageInterface
array getReplaces()

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

from PackageInterface
array getDevRequires()

Returns a set of links to packages which are required to develop this package.

from PackageInterface
array getSuggests()

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

from PackageInterface
array getAutoload()

Returns an associative array of autoloading rules

from PackageInterface
array getDevAutoload()

Returns an associative array of dev autoloading rules

from PackageInterface
array getIncludePaths()

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

from PackageInterface
setRepository(RepositoryInterface $repository)

Stores a reference to the repository that owns the package

from PackageInterface
RepositoryInterface getRepository()

Returns a reference to the repository that owns the package

from PackageInterface
array getBinaries()

Returns the package binaries

from PackageInterface
string getUniqueName()

Returns package unique name, constructed from name and version.

from PackageInterface
string getNotificationUrl()

Returns the package notification url

from PackageInterface
string __toString()

Converts the package into a readable and unique string

from PackageInterface
string getPrettyString()

Converts the package into a pretty readable string

from PackageInterface
array getArchiveExcludes()

Returns a list of patterns to exclude from package archives

from PackageInterface
array getTransportOptions()

Returns a list of options to download package dist files

from PackageInterface
array getScripts()

Returns the scripts of this package

array getRepositories()

Returns an array of repositories

array getLicense()

Returns the package license, e.g.

array getKeywords()

Returns an array of keywords relating to the package

string getDescription()

Returns the package description

string getHomepage()

Returns the package homepage

array getAuthors()

Returns an array of authors of the package

array getSupport()

Returns the support information

bool isAbandoned()

Returns if the package is abandoned or not

string getReplacementPackage()

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

Details

in PackageInterface at line 29
public string getName()

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

Return Value

string package name

in PackageInterface at line 36
public string getPrettyName()

Returns the package's pretty (i.e.

with proper case) name

Return Value

string package name

in PackageInterface at line 46
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

in PackageInterface at line 53
public setId(int $id)

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

Parameters

int $id

in PackageInterface at line 60
public int getId()

Retrieves the package's id set through setId

Return Value

int The previously set package id

in PackageInterface at line 67
public bool isDev()

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

Return Value

bool

in PackageInterface at line 74
public string getType()

Returns the package type, e.g.

library

Return Value

string The package type

in PackageInterface at line 81
public string getTargetDir()

Returns the package targetDir property

Return Value

string The package targetDir

in PackageInterface at line 88
public array getExtra()

Returns the package extra data

Return Value

array The package extra data

in PackageInterface at line 95
public setInstallationSource(string $type)

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

Parameters

string $type source/dist

in PackageInterface at line 102
public string getInstallationSource()

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

Return Value

string source/dist

in PackageInterface at line 109
public string getSourceType()

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

git, svn

Return Value

string The repository type

in PackageInterface at line 116
public string getSourceUrl()

Returns the repository url of this package, e.g.

git://github.com/naderman/composer.git

Return Value

string The repository url

in PackageInterface at line 123
public array getSourceUrls()

Returns the repository urls of this package including mirrors, e.g.

git://github.com/naderman/composer.git

Return Value

array

in PackageInterface at line 130
public 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

in PackageInterface at line 137
public array|null getSourceMirrors()

Returns the source mirrors of this package

Return Value

array|null

in PackageInterface at line 144
public string getDistType()

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

zip, tarball

Return Value

string The repository type

in PackageInterface at line 151
public string getDistUrl()

Returns the url of the distribution archive of this version

Return Value

string

in PackageInterface at line 158
public array getDistUrls()

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

Return Value

array

in PackageInterface at line 165
public 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

in PackageInterface at line 172
public string getDistSha1Checksum()

Returns the sha1 checksum for the distribution archive of this version

Return Value

string

in PackageInterface at line 179
public array|null getDistMirrors()

Returns the dist mirrors of this package

Return Value

array|null

in PackageInterface at line 186
public string getVersion()

Returns the version of this package

Return Value

string version

in PackageInterface at line 193
public string getPrettyVersion()

Returns the pretty (i.e.

non-normalized) version string of this package

Return Value

string version

in PackageInterface at line 203
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

See also

getPrettyVersion

in PackageInterface at line 210
public DateTime getReleaseDate()

Returns the release date of the package

Return Value

DateTime

in PackageInterface at line 217
public string getStability()

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

Return Value

string

in PackageInterface at line 225
public array getRequires()

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

Return Value

array An array of package links defining required packages

in PackageInterface at line 233
public array getConflicts()

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

Return Value

array An array of package links defining conflicting packages

in PackageInterface at line 241
public array getProvides()

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

Return Value

array An array of package links defining provided packages

in PackageInterface at line 249
public array getReplaces()

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

Return Value

array An array of package links defining replaced packages

in PackageInterface at line 257
public array getDevRequires()

Returns a set of links to packages which are required to develop this package.

These are installed if in dev mode.

Return Value

array An array of package links defining packages required for development

in PackageInterface at line 265
public 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

in PackageInterface at line 277
public 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

in PackageInterface at line 289
public 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

in PackageInterface at line 297
public array getIncludePaths()

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

Return Value

array

in PackageInterface at line 304
public setRepository(RepositoryInterface $repository)

Stores a reference to the repository that owns the package

Parameters

RepositoryInterface $repository

in PackageInterface at line 311
public RepositoryInterface getRepository()

Returns a reference to the repository that owns the package

Return Value

RepositoryInterface

in PackageInterface at line 318
public array getBinaries()

Returns the package binaries

Return Value

array

in PackageInterface at line 325
public string getUniqueName()

Returns package unique name, constructed from name and version.

Return Value

string

in PackageInterface at line 332
public string getNotificationUrl()

Returns the package notification url

Return Value

string

in PackageInterface at line 339
public string __toString()

Converts the package into a readable and unique string

Return Value

string

in PackageInterface at line 346
public string getPrettyString()

Converts the package into a pretty readable string

Return Value

string

in PackageInterface at line 353
public array getArchiveExcludes()

Returns a list of patterns to exclude from package archives

Return Value

array

in PackageInterface at line 360
public array getTransportOptions()

Returns a list of options to download package dist files

Return Value

array

at line 27
public array getScripts()

Returns the scripts of this package

Return Value

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

at line 36
public array getRepositories()

Returns an array of repositories

{"": {}}

Return Value

array Repositories

at line 43
public array getLicense()

Returns the package license, e.g.

MIT, BSD, GPL

Return Value

array The package licenses

at line 50
public array getKeywords()

Returns an array of keywords relating to the package

Return Value

array

at line 57
public string getDescription()

Returns the package description

Return Value

string

at line 64
public string getHomepage()

Returns the package homepage

Return Value

string

at line 73
public array getAuthors()

Returns an array of authors of the package

Each item can contain name/homepage/email keys

Return Value

array

at line 80
public array getSupport()

Returns the support information

Return Value

array

at line 87
public bool isAbandoned()

Returns if the package is abandoned or not

Return Value

bool

at line 94
public string getReplacementPackage()

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

Return Value

string