Composer API
Class

Composer\Installer\SuggestedPackagesReporter

class SuggestedPackagesReporter

Add suggested packages from different places to output them in the end.

Methods

__construct(IOInterface $io)

array getPackages()

SuggestedPackagesReporter addPackage(string $source, string $target, string $reason)

Add suggested packages to be listed after install

SuggestedPackagesReporter addSuggestionsFromPackage(PackageInterface $package)

Add all suggestions from a package.

SuggestedPackagesReporter output(RepositoryInterface $installedRepo = null)

Output suggested packages.

Details

at line 37
public __construct(IOInterface $io)

Parameters

IOInterface $io

at line 45
public array getPackages()

Return Value

array Suggested packages with source, target and reason keys.

at line 61
public SuggestedPackagesReporter addPackage(string $source, string $target, string $reason)

Add suggested packages to be listed after install

Could be used to add suggested packages both from the installer or from CreateProjectCommand.

Parameters

string $source Source package which made the suggestion
string $target Target package to be suggested
string $reason Reason the target package to be suggested

Return Value

SuggestedPackagesReporter

at line 78
public SuggestedPackagesReporter addSuggestionsFromPackage(PackageInterface $package)

Add all suggestions from a package.

Parameters

PackageInterface $package

Return Value

SuggestedPackagesReporter

at line 99
public SuggestedPackagesReporter output(RepositoryInterface $installedRepo = null)

Output suggested packages.

Do not list the ones already installed if installed repository provided.

Parameters

RepositoryInterface $installedRepo Installed packages

Return Value

SuggestedPackagesReporter