Final Class Yiisoft\Config\Composer\PackagesListBuilder
| Inheritance | Yiisoft\ |
|---|
Public Methods
| Method | Description | Defined By |
|---|---|---|
| __construct() | Yiisoft\ |
|
| build() | Builds and returns packages. | Yiisoft\ |
Method Details
| public mixed __construct ( \ | ||
| $composer | \ |
|
| $packageTypes | array | |
public function __construct(
private readonly Composer $composer,
private readonly array $packageTypes,
) {}
Builds and returns packages.
| public array |
public function build(): array
{
$allPackages = $this->getAllPackages();
$packageDepths = [];
$this->calculatePackageDepths($allPackages, $packageDepths, 0, $this->composer->getPackage(), true);
$result = [];
foreach ($this->getSortedPackageNames($packageDepths) as $name) {
if (array_key_exists($name, $allPackages)) {
$result[$name] = $allPackages[$name];
}
}
return $result;
}
User Contributed Notes
Leave a comment
Join the conversation to share a note.