From f15caa9c7f4ebd52389b81fd8a52a438b3328547 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20PLANCHAT?= Date: Thu, 1 Feb 2024 10:58:25 +0100 Subject: [PATCH] Apply suggestions from code review --- src/Dockerfile/Arg.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Dockerfile/Arg.php b/src/Dockerfile/Arg.php index 2f8fcd6..7ce8347 100644 --- a/src/Dockerfile/Arg.php +++ b/src/Dockerfile/Arg.php @@ -8,12 +8,15 @@ { public function __construct( private string $name, - private string $defaultValue, + private ?string $defaultValue = null, ) { } public function __toString(): string { - return sprintf('ARG %s=%s', $this->name, $this->defaultValue); + if ($this->defaultValue !== null) { + return sprintf('ARG %s=%s', $this->name, $this->defaultValue); + } + return sprintf('ARG %s', $this->name); } }