Dumplie\Customer\Domain\Address::__construct PHP Method

__construct() public method

public __construct ( string $name, string $street, string $postCode, string $city, string $countryIso2code )
$name string
$street string
$postCode string
$city string
$countryIso2code string
    public function __construct(string $name, string $street, string $postCode, string $city, string $countryIso2code)
    {
        if (empty($name)) {
            throw InvalidArgumentException::invalidAddress('', 'name');
        }
        if (empty($street)) {
            throw InvalidArgumentException::invalidAddress('', 'street');
        }
        if (empty($postCode)) {
            throw InvalidArgumentException::invalidAddress('', 'post code');
        }
        if (empty($city)) {
            throw InvalidArgumentException::invalidAddress('', 'city');
        }
        if (empty($countryIso2code)) {
            throw InvalidArgumentException::invalidAddress('', 'country ISO2 code');
        }
        if (mb_strlen($countryIso2code) !== 2) {
            throw InvalidArgumentException::invalidAddress($countryIso2code, 'country ISO2 code');
        }
        $this->name = $name;
        $this->street = $street;
        $this->postCode = $postCode;
        $this->city = $city;
        $this->countryIso2code = $countryIso2code;
    }