SuggestedPackagesReporter
in package
Add suggested packages from different places to output them in the end.
Tags
Table of Contents
- $suggestedPackages : array<string|int, mixed>
- $io : IOInterface
- __construct() : mixed
- addPackage() : SuggestedPackagesReporter
- Add suggested packages to be listed after install
- addSuggestionsFromPackage() : SuggestedPackagesReporter
- Add all suggestions from a package.
- getPackages() : array<string|int, mixed>
- output() : SuggestedPackagesReporter
- Output suggested packages.
- escapeOutput() : string
- removeControlCharacters() : string
Properties
$suggestedPackages
protected
array<string|int, mixed>
$suggestedPackages
= array()
$io
private
IOInterface
$io
Methods
__construct()
public
__construct(IOInterface $io) : mixed
Parameters
- $io : IOInterface
Return values
mixed —addPackage()
Add suggested packages to be listed after install
public
addPackage(string $source, string $target, string $reason) : SuggestedPackagesReporter
Could be used to add suggested packages both from the installer or from CreateProjectCommand.
Parameters
- $source : string
-
Source package which made the suggestion
- $target : string
-
Target package to be suggested
- $reason : string
-
Reason the target package to be suggested
Return values
SuggestedPackagesReporter —addSuggestionsFromPackage()
Add all suggestions from a package.
public
addSuggestionsFromPackage(PackageInterface $package) : SuggestedPackagesReporter
Parameters
- $package : PackageInterface
Return values
SuggestedPackagesReporter —getPackages()
public
getPackages() : array<string|int, mixed>
Return values
array<string|int, mixed> —Suggested packages with source, target and reason keys.
output()
Output suggested packages.
public
output([RepositoryInterface $installedRepo = null ]) : SuggestedPackagesReporter
Do not list the ones already installed if installed repository provided.
Parameters
- $installedRepo : RepositoryInterface = null
-
Installed packages
Return values
SuggestedPackagesReporter —escapeOutput()
private
escapeOutput(string $string) : string
Parameters
- $string : string
Return values
string —removeControlCharacters()
private
removeControlCharacters(string $string) : string
Parameters
- $string : string