public function __construct($name, TaxIdNumber $taxIdNumber, Address $address, BankAccount $account) { $this->name = $name; $this->taxIdNumber = (string) $taxIdNumber; $this->postalCode = $address->getPostalCode(); $this->street = $address->getStreet(); $this->city = $address->getCity(); $this->country = $address->getCountry(); $this->bankName = $account->getBankName(); $this->bankNumber = $account->getBankNumber(); $this->bicCode = $account->getBicCode(); }
public function __construct($name, TaxIdNumber $taxIdNumber, Address $address, BankAccount $account) { if (!$name) { throw new \InvalidArgumentException('Name is required'); } $this->name = $name; $this->taxIdNumber = (string) $taxIdNumber; $this->postalCode = $address->getPostalCode(); $this->street = $address->getStreet(); $this->city = $address->getCity(); $this->country = $address->getCountry(); $this->bankName = $account->getBankName(); $this->bankNumber = $account->getBankNumber(); $this->bicCode = $account->getBicCode(); }