Skip to content

Commit

Permalink
Add missing suggests from config to package
Browse files Browse the repository at this point in the history
Signed-off-by: Andreas Frömer <andreas.froemer@check24.de>
  • Loading branch information
Andreas Frömer authored and icanhazstring committed Jan 4, 2022
1 parent b4d1c1c commit 8da70a4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Composer/Config.php
Expand Up @@ -13,6 +13,8 @@ final class Config
private array $require = [];
/** @var array<string, mixed> */
private array $autoload = [];
/** @var array<string, string> */
private array $suggests = [];

public function getName(): string
{
Expand All @@ -35,6 +37,14 @@ public function getAutoload(): array
return $this->autoload;
}

/**
* @return array<string, string>
*/
public function getSuggests(): array
{
return $this->suggests;
}

public function get(string $property): string
{
$value = $this->config[$property] ?? null;
Expand Down
1 change: 1 addition & 0 deletions src/Composer/Package.php
Expand Up @@ -24,6 +24,7 @@ public static function fromConfig(Config $config): self
$package->requires = array_map(static function (string $name) {
return new Link($name);
}, array_keys($config->getRequire()));
$package->suggests = array_keys($config->getSuggests());

return $package;
}
Expand Down

0 comments on commit 8da70a4

Please sign in to comment.