From 8da70a4ca18b2e15eda5e29c2e7926832856fb9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Fr=C3=B6mer?= Date: Tue, 4 Jan 2022 16:19:20 +0100 Subject: [PATCH] Add missing suggests from config to package MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Andreas Frömer --- src/Composer/Config.php | 10 ++++++++++ src/Composer/Package.php | 1 + 2 files changed, 11 insertions(+) diff --git a/src/Composer/Config.php b/src/Composer/Config.php index 6f8433f1..e345a3f1 100644 --- a/src/Composer/Config.php +++ b/src/Composer/Config.php @@ -13,6 +13,8 @@ final class Config private array $require = []; /** @var array */ private array $autoload = []; + /** @var array */ + private array $suggests = []; public function getName(): string { @@ -35,6 +37,14 @@ public function getAutoload(): array return $this->autoload; } + /** + * @return array + */ + public function getSuggests(): array + { + return $this->suggests; + } + public function get(string $property): string { $value = $this->config[$property] ?? null; diff --git a/src/Composer/Package.php b/src/Composer/Package.php index d3e89500..f085de48 100644 --- a/src/Composer/Package.php +++ b/src/Composer/Package.php @@ -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; }