Skip to content

Commit

Permalink
Make AddressFactory trim the street, state, city and zip codes
Browse files Browse the repository at this point in the history
  • Loading branch information
ericksonreyes committed Jun 24, 2019
1 parent 8bec1c0 commit b1d5949
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,15 @@ public static function create(
string $state,
string $countryIso2Code,
string $zipCode
): Address {
): Address
{
$country = CountryFactory::create($countryIso2Code);
return new Address($street, $city, $state, $country, $zipCode);
return new Address(
trim($street),
trim($city),
trim($state),
$country,
trim($zipCode)
);
}
}

0 comments on commit b1d5949

Please sign in to comment.