Skip to content

Commit e7b16de

Browse files
committed
Improves Street format
1 parent aa61565 commit e7b16de

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)