Skip to content

Commit

Permalink
Resolve Psalm's PossiblyNullOperand - Cannot concatenate with a possi…
Browse files Browse the repository at this point in the history
…bly null|string (#227)

Follow-up to #225
  • Loading branch information
spaze authored Sep 15, 2023
2 parents 01e690f + 3bd534c commit b412f35
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions site/app/CompanyInfo/CompanyRegisterAres.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,14 @@ private function formatStreet(?string $city, ?string $street, ?int $houseNumber,
$result = $city;
}
if (!empty($streetLetter)) {
$streetNumber .= $streetLetter;
$streetNumber = ($streetNumber ?? '') . $streetLetter;
}
if (!empty($houseNumber) && !empty($streetNumber)) {
$result .= " {$houseNumber}/{$streetNumber}";
$result = "{$result} {$houseNumber}/{$streetNumber}";
} elseif (!empty($houseNumber)) {
$result .= " {$houseNumber}";
$result = "{$result} {$houseNumber}";
} elseif (!empty($streetNumber)) {
$result .= " {$streetNumber}";
$result = "{$result} {$streetNumber}";
}
return $result;
}
Expand Down

0 comments on commit b412f35

Please sign in to comment.