PHP Class Monorepo\Composer\MonorepoInstalledRepository

Inheritance: implements Composer\Repository\InstalledRepositoryInterface
Show file Open project: beberlei/composer-monorepo-plugin

Public Methods

Method Description
addPackage ( Composer\Package\PackageInterface $package ) Adds package to the repository.
count ( )
findPackage ( string $name, string $version ) : Composer\Package\PackageInterface | null Searches for the first match of a package by name and version.
findPackages ( string $name, string $version = null ) : array Searches for all packages matching a name and optionally a version.
getCanonicalPackages ( ) : Composer\Package\PackageInterface[] Get unique packages, with aliases resolved and removed
getPackages ( ) : array Returns list of registered packages.
hasPackage ( Composer\Package\PackageInterface $package ) : boolean Checks if specified package registered (installed).
reload ( ) Forces a reload of all packages
removePackage ( Composer\Package\PackageInterface $package ) Removes package from the repository.
search ( string $query, integer $mode ) : array[] Searches the repository for packages containing the query
write ( ) Writes repository (f.e. to the disc).

Method Details

addPackage() public method

Adds package to the repository.
public addPackage ( Composer\Package\PackageInterface $package )
$package Composer\Package\PackageInterface package instance

count() public method

public count ( )

findPackage() public method

Searches for the first match of a package by name and version.
public findPackage ( string $name, string $version ) : Composer\Package\PackageInterface | null
$name string package name
$version string package version
return Composer\Package\PackageInterface | null

findPackages() public method

Searches for all packages matching a name and optionally a version.
public findPackages ( string $name, string $version = null ) : array
$name string package name
$version string package version
return array

getCanonicalPackages() public method

Get unique packages, with aliases resolved and removed
public getCanonicalPackages ( ) : Composer\Package\PackageInterface[]
return Composer\Package\PackageInterface[]

getPackages() public method

Returns list of registered packages.
public getPackages ( ) : array
return array

hasPackage() public method

Checks if specified package registered (installed).
public hasPackage ( Composer\Package\PackageInterface $package ) : boolean
$package Composer\Package\PackageInterface package instance
return boolean

reload() public method

Forces a reload of all packages
public reload ( )

removePackage() public method

Removes package from the repository.
public removePackage ( Composer\Package\PackageInterface $package )
$package Composer\Package\PackageInterface package instance

write() public method

Writes repository (f.e. to the disc).
public write ( )