Skip to content

Commit ee1b4e2

Browse files
authored
Merge pull request #16 from Talentify/develop
Improve Street format
2 parents d8f739e + e7b16de commit ee1b4e2

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Geography/Address/Street.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,12 @@ public function equals(?ValueObject $object) : bool
9696

9797
public function getFormatted() : string
9898
{
99-
return sprintf('%s %s, %s', $this->getName(), $this->getNumber(), $this->getOtherIdentifiers());
99+
$firstPart = sprintf('%s %s', $this->getNumber(), $this->getName());
100+
if ($this->getOtherIdentifiers()) {
101+
return $firstPart . ', ' . $this->getOtherIdentifiers();
102+
}
103+
104+
return $firstPart;
100105
}
101106

102107
public function __toString() : string

0 commit comments

Comments
 (0)