|
@@ -47,17 +47,7 @@ class Address extends Model {
|
|
|
|
|
|
|
|
// Magic methods
|
|
// Magic methods
|
|
|
public function __toString(): string {
|
|
public function __toString(): string {
|
|
|
- $county_parts = array_filter([$this->county, $this->state, $this->postal_code]);
|
|
|
|
|
-
|
|
|
|
|
- $lines = array_filter([
|
|
|
|
|
- $this->address_1,
|
|
|
|
|
- $this->address_2,
|
|
|
|
|
- $this->city,
|
|
|
|
|
- implode(", ", $county_parts),
|
|
|
|
|
- $this->getDisplayCountry()
|
|
|
|
|
- ]);
|
|
|
|
|
-
|
|
|
|
|
- return implode("\n", $lines);
|
|
|
|
|
|
|
+ return implode("\n", $this->getLines());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// Object methods
|
|
// Object methods
|
|
@@ -88,4 +78,16 @@ class Address extends Model {
|
|
|
return "";
|
|
return "";
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ public function getLines(): array {
|
|
|
|
|
+ $county_parts = array_filter([$this->county, $this->state, $this->postal_code]);
|
|
|
|
|
+
|
|
|
|
|
+ return array_filter([
|
|
|
|
|
+ $this->address_1,
|
|
|
|
|
+ $this->address_2,
|
|
|
|
|
+ $this->city,
|
|
|
|
|
+ implode(", ", $county_parts),
|
|
|
|
|
+ $this->getDisplayCountry()
|
|
|
|
|
+ ]);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|