diff --git a/src/EricksonReyes/DomainDrivenDesign/Common/Factory/AddressFactory.php b/src/EricksonReyes/DomainDrivenDesign/Common/Factory/AddressFactory.php index 7fdab44..fccaeb9 100644 --- a/src/EricksonReyes/DomainDrivenDesign/Common/Factory/AddressFactory.php +++ b/src/EricksonReyes/DomainDrivenDesign/Common/Factory/AddressFactory.php @@ -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) + ); } }