From 312d50e8ec180aa734f13ebbe9b546bbccd1c43c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20PLANCHAT?= Date: Thu, 1 Feb 2024 11:04:38 +0100 Subject: [PATCH] Apply suggestions from code review --- src/PHP/ComposerConfigGlobal.php | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/PHP/ComposerConfigGlobal.php b/src/PHP/ComposerConfigGlobal.php index 19f8967..62fef2a 100644 --- a/src/PHP/ComposerConfigGlobal.php +++ b/src/PHP/ComposerConfigGlobal.php @@ -10,18 +10,15 @@ { public function __construct( private string $host, - private string $token, + private string $tokenArgument, ) { } public function __toString(): string { - return (string) new Dockerfile\Run(sprintf( - <<<'RUN' - composer config --global %s %s - RUN, - $this->host, - $this->token, - )); + return (string) new Dockerfile\Run(<<<"RUN" + composer config --global {$this->host} \${{$this->tokenArgument}} + RUN, + ); } }