From 569497d7ec9a98da95b45547e3fdd9abbf20bd1a Mon Sep 17 00:00:00 2001 From: sebprt Date: Fri, 26 Jan 2024 17:18:44 +0100 Subject: [PATCH] Added a default value for the ARG syntax + rename class with Global prefix --- src/Dockerfile/Arg.php | 3 ++- src/PHP/{ComposerConfig.php => ComposerConfigGlobal.php} | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) rename src/PHP/{ComposerConfig.php => ComposerConfigGlobal.php} (84%) diff --git a/src/Dockerfile/Arg.php b/src/Dockerfile/Arg.php index 5035f5b..2f8fcd6 100644 --- a/src/Dockerfile/Arg.php +++ b/src/Dockerfile/Arg.php @@ -8,11 +8,12 @@ { public function __construct( private string $name, + private string $defaultValue, ) { } public function __toString(): string { - return sprintf('ARG %s', $this->name); + return sprintf('ARG %s=%s', $this->name, $this->defaultValue); } } diff --git a/src/PHP/ComposerConfig.php b/src/PHP/ComposerConfigGlobal.php similarity index 84% rename from src/PHP/ComposerConfig.php rename to src/PHP/ComposerConfigGlobal.php index d835195..19f8967 100644 --- a/src/PHP/ComposerConfig.php +++ b/src/PHP/ComposerConfigGlobal.php @@ -6,7 +6,7 @@ use Kiboko\Component\Dockerfile\Dockerfile; -final readonly class ComposerConfig implements Dockerfile\LayerInterface, \Stringable +final readonly class ComposerConfigGlobal implements Dockerfile\LayerInterface, \Stringable { public function __construct( private string $host,