Composer API
Interface

Composer\Repository\RepositoryInterface

interface RepositoryInterface implements Countable

Repository interface.

Constants

SEARCH_FULLTEXT

SEARCH_NAME

Methods

bool hasPackage(PackageInterface $package)

Checks if specified package registered (installed).

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

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

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

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

PackageInterface[] getPackages()

Returns list of registered packages.

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

Searches the repository for packages containing the query

Details

at line 36
public bool hasPackage(PackageInterface $package)

Checks if specified package registered (installed).

Parameters

PackageInterface $package package instance

Return Value

bool

at line 46
public 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

at line 56
public 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[]

at line 63
public 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' => '...')