Skip to content

Commit f15caa9

Browse files
authored
Apply suggestions from code review
1 parent 569497d commit f15caa9

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/Dockerfile/Arg.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,15 @@
88
{
99
public function __construct(
1010
private string $name,
11-
private string $defaultValue,
11+
private ?string $defaultValue = null,
1212
) {
1313
}
1414

1515
public function __toString(): string
1616
{
17-
return sprintf('ARG %s=%s', $this->name, $this->defaultValue);
17+
if ($this->defaultValue !== null) {
18+
return sprintf('ARG %s=%s', $this->name, $this->defaultValue);
19+
}
20+
return sprintf('ARG %s', $this->name);
1821
}
1922
}

0 commit comments

Comments
 (0)