interface RepositoryInterface implements Countable (View source)

Repository interface.

Constants

SEARCH_FULLTEXT

SEARCH_NAME

Methods

bool
hasPackage(PackageInterface $package)

Checks if specified package registered (installed).

findPackage(string $name, string|ConstraintInterface $constraint)

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

findPackages(string $name, string|ConstraintInterface $constraint = null)

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

getPackages()

Returns list of registered packages.

array[]
search(string $query, int $mode = 0)

Searches the repository for packages containing the query

Details

bool hasPackage(PackageInterface $package)

Checks if specified package registered (installed).

Parameters

PackageInterface $package package instance

Return Value

bool

PackageInterface|null findPackage(string $name, string|ConstraintInterface $constraint)

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

Parameters

string $name package name
string|ConstraintInterface $constraint package version or version constraint to match against

Return Value

PackageInterface|null

PackageInterface[] findPackages(string $name, string|ConstraintInterface $constraint = null)

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

Parameters

string $name package name
string|ConstraintInterface $constraint package version or version constraint to match against

Return Value

PackageInterface[]

PackageInterface[] getPackages()

Returns list of registered packages.

Return Value

PackageInterface[]

Searches the repository for packages containing the query

Parameters

string $query search query
int $mode a set of SEARCH_* constants to search on, implementations should do a best effort only

Return Value

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