Methods

getScripts()

getScripts() : array

Returns the scripts of this package

Returns

array —

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

getRepositories()

getRepositories() : array

Returns an array of repositories

{"": {<config key/values>}}

Returns

array —

Repositories

getLicense()

getLicense() : array

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

Returns

array —

The package licenses

getKeywords()

getKeywords() : array

Returns an array of keywords relating to the package

Returns

array

getDescription()

getDescription() : string

Returns the package description

Returns

string

getHomepage()

getHomepage() : string

Returns the package homepage

Returns

string

getAuthors()

getAuthors() : array

Returns an array of authors of the package

Each item can contain name/homepage/email keys

Returns

array

getSupport()

getSupport() : array

Returns the support information

Returns

array

isAbandoned()

isAbandoned() : boolean

Returns if the package is abandoned or not

Returns

boolean

getReplacementPackage()

getReplacementPackage() : string

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

Returns

string

getName()

getName() : string

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

Returns

string —

package name

getPrettyName()

getPrettyName() : string

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

Returns

string —

package name

getNames()

getNames() : array

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.

Returns

array —

An array of strings referring to this package

setId()

setId(integer  $id) 

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

Parameters

integer $id

getId()

getId() : integer

Retrieves the package's id set through setId

Returns

integer —

The previously set package id

isDev()

isDev() : boolean

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

Returns

boolean

getType()

getType() : string

Returns the package type, e.g. library

Returns

string —

The package type

getTargetDir()

getTargetDir() : string

Returns the package targetDir property

Returns

string —

The package targetDir

getExtra()

getExtra() : array

Returns the package extra data

Returns

array —

The package extra data

setInstallationSource()

setInstallationSource(string  $type) 

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

Parameters

string $type

source/dist

getInstallationSource()

getInstallationSource() : string

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

Returns

string —

source/dist

getSourceType()

getSourceType() : string

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

Returns

string —

The repository type

getSourceUrl()

getSourceUrl() : string

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

Returns

string —

The repository url

getSourceUrls()

getSourceUrls() : array

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

Returns

array

getSourceReference()

getSourceReference() : string

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

Returns

string —

The repository reference

getSourceMirrors()

getSourceMirrors() : array|null

Returns the source mirrors of this package

Returns

array|null

getDistType()

getDistType() : string

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

Returns

string —

The repository type

getDistUrl()

getDistUrl() : string

Returns the url of the distribution archive of this version

Returns

string

getDistUrls()

getDistUrls() : array

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

Returns

array

getDistReference()

getDistReference() : string

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

Returns

string

getDistSha1Checksum()

getDistSha1Checksum() : string

Returns the sha1 checksum for the distribution archive of this version

Returns

string

getDistMirrors()

getDistMirrors() : array|null

Returns the dist mirrors of this package

Returns

array|null

getVersion()

getVersion() : string

Returns the version of this package

Returns

string —

version

getPrettyVersion()

getPrettyVersion() : string

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

Returns

string —

version

getFullPrettyVersion()

getFullPrettyVersion(boolean  $truncate = true) : string

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

Parameters

boolean $truncate

If the source reference is a sha1 hash, truncate it

Returns

string —

version

getReleaseDate()

getReleaseDate() : \DateTime

Returns the release date of the package

Returns

\DateTime

getStability()

getStability() : string

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

Returns

string

getRequires()

getRequires() : array<mixed,\Composer\Package\Link>

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

Returns

array<mixed,\Composer\Package\Link> —

An array of package links defining required packages

getConflicts()

getConflicts() : array<mixed,\Composer\Package\Link>

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

Returns

array<mixed,\Composer\Package\Link> —

An array of package links defining conflicting packages

getProvides()

getProvides() : array<mixed,\Composer\Package\Link>

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

Returns

array<mixed,\Composer\Package\Link> —

An array of package links defining provided packages

getReplaces()

getReplaces() : array<mixed,\Composer\Package\Link>

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

Returns

array<mixed,\Composer\Package\Link> —

An array of package links defining replaced packages

getDevRequires()

getDevRequires() : array<mixed,\Composer\Package\Link>

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

Returns

array<mixed,\Composer\Package\Link> —

An array of package links defining packages required for development

getSuggests()

getSuggests() : array

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

Returns

array —

An array of package suggestions with descriptions

getAutoload()

getAutoload() : array

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.

Returns

array —

Mapping of autoloading rules

getDevAutoload()

getDevAutoload() : array

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.

Returns

array —

Mapping of dev autoloading rules

getIncludePaths()

getIncludePaths() : array

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

Returns

array

setRepository()

setRepository(\Composer\Repository\RepositoryInterface  $repository) 

Stores a reference to the repository that owns the package

Parameters

\Composer\Repository\RepositoryInterface $repository

getBinaries()

getBinaries() : array

Returns the package binaries

Returns

array

getUniqueName()

getUniqueName() : string

Returns package unique name, constructed from name and version.

Returns

string

getNotificationUrl()

getNotificationUrl() : string

Returns the package notification url

Returns

string

__toString()

__toString() : string

Converts the package into a readable and unique string

Returns

string

getPrettyString()

getPrettyString() : string

Converts the package into a pretty readable string

Returns

string

getArchiveExcludes()

getArchiveExcludes() : array

Returns a list of patterns to exclude from package archives

Returns

array

getTransportOptions()

getTransportOptions() : array

Returns a list of options to download package dist files

Returns

array

getAliases()

getAliases() : array

Returns a set of package names and their aliases

Returns

array

getMinimumStability()

getMinimumStability() : string

Returns the minimum stability of the package

Returns

string

getStabilityFlags()

getStabilityFlags() : array

Returns the stability flags to apply to dependencies

array('foo/bar' => 'dev')

Returns

array

getReferences()

getReferences() : array

Returns a set of package names and source references that must be enforced on them

array('foo/bar' => 'abcd1234')

Returns

array

getPreferStable()

getPreferStable() : boolean

Returns true if the root package prefers picking stable packages over unstable ones

Returns

boolean

getConfig()

getConfig() : array

Returns the root package's configuration

Returns

array

setRequires()

setRequires(array<mixed,\Composer\Package\Link>  $requires) 

Set the required packages

Parameters

array<mixed,\Composer\Package\Link> $requires

A set of package links

setDevRequires()

setDevRequires(array<mixed,\Composer\Package\Link>  $devRequires) 

Set the recommended packages

Parameters

array<mixed,\Composer\Package\Link> $devRequires

A set of package links

setConflicts()

setConflicts(array<mixed,\Composer\Package\Link>  $conflicts) 

Set the conflicting packages

Parameters

array<mixed,\Composer\Package\Link> $conflicts

A set of package links

setProvides()

setProvides(array<mixed,\Composer\Package\Link>  $provides) 

Set the provided virtual packages

Parameters

array<mixed,\Composer\Package\Link> $provides

A set of package links

setReplaces()

setReplaces(array<mixed,\Composer\Package\Link>  $replaces) 

Set the packages this one replaces

Parameters

array<mixed,\Composer\Package\Link> $replaces

A set of package links

setRepositories()

setRepositories(array  $repositories) 

Set the repositories

Parameters

array $repositories

setAutoload()

setAutoload(array  $autoload) 

Set the autoload mapping

Parameters

array $autoload

Mapping of autoloading rules

setDevAutoload()

setDevAutoload(array  $devAutoload) 

Set the dev autoload mapping

Parameters

array $devAutoload

Mapping of dev autoloading rules

setStabilityFlags()

setStabilityFlags(array  $stabilityFlags) 

Set the stabilityFlags

Parameters

array $stabilityFlags

setSuggests()

setSuggests(array  $suggests) 

Set the suggested packages

Parameters

array $suggests

A set of package names/comments

setExtra()

setExtra(array  $extra) 

Parameters

array $extra