\Composer\RepositoryRepositoryInterface

Repository interface.

Summary

Methods
Constants
hasPackage()
findPackage()
findPackages()
getPackages()
search()
SEARCH_FULLTEXT
SEARCH_NAME
No protected methods found
N/A
No private methods found
N/A

Constants

SEARCH_FULLTEXT

SEARCH_FULLTEXT = 0

SEARCH_NAME

SEARCH_NAME = 1

Methods

hasPackage()

hasPackage(\Composer\Package\PackageInterface  $package) : boolean

Checks if specified package registered (installed).

Parameters

\Composer\Package\PackageInterface $package

package instance

Returns

boolean

findPackage()

findPackage(string  $name, string|\Composer\Semver\Constraint\ConstraintInterface  $constraint) : \Composer\Package\PackageInterface|null

Searches for the first match of a package by name and version.

Parameters

string $name

package name

string|\Composer\Semver\Constraint\ConstraintInterface $constraint

package version or version constraint to match against

Returns

\Composer\Package\PackageInterface|null

findPackages()

findPackages(string  $name, string|\Composer\Semver\Constraint\ConstraintInterface  $constraint = null) : array<mixed,\Composer\Package\PackageInterface>

Searches for all packages matching a name and optionally a version.

Parameters

string $name

package name

string|\Composer\Semver\Constraint\ConstraintInterface $constraint

package version or version constraint to match against

Returns

array<mixed,\Composer\Package\PackageInterface>

getPackages()

getPackages() : array<mixed,\Composer\Package\PackageInterface>

Returns list of registered packages.

Returns

array<mixed,\Composer\Package\PackageInterface>

search()

search(string  $query, integer  $mode) : array<mixed,array>

Searches the repository for packages containing the query

Parameters

string $query

search query

integer $mode

a set of SEARCH_* constants to search on, implementations should do a best effort only

Returns

array<mixed,array> —

an array of array('name' => '...', 'description' => '...')