Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
gplanchat authored Feb 1, 2024
1 parent 569497d commit f15caa9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Dockerfile/Arg.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

0 comments on commit f15caa9

Please sign in to comment.