| Total Complexity | 6 |
| Total Lines | 26 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 2 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 13 | final class EnvLine implements LineInterface |
||
| 14 | { |
||
| 15 | 52 | public function __construct(private Key $key, private ?Value $value = null, private ?Comment $comment = null) |
|
| 16 | { |
||
| 17 | } |
||
| 18 | |||
| 19 | 10 | public function __toString(): string |
|
| 20 | { |
||
| 21 | 10 | $format = ($this->value === null) ? '%s%s%s' : '%s=%s%s'; |
|
| 22 | /** @psalm-suppress ImplicitToStringCast, PossiblyNullArgument */ |
||
| 23 | 10 | return sprintf($format, $this->key, $this->value, $this->comment); |
|
| 24 | } |
||
| 25 | |||
| 26 | 43 | public function getKey(): Key |
|
| 27 | { |
||
| 28 | 43 | return $this->key; |
|
| 29 | } |
||
| 30 | |||
| 31 | 42 | public function getValue(): ?Value |
|
| 34 | } |
||
| 35 | |||
| 36 | 1 | public function getComment(): ?Comment |
|
| 39 | } |
||
| 40 | } |
||
| 41 |