/** * Validates properties * * @throws InvoiceException */ private function validate() { foreach (['name', 'town', 'address', 'zip', 'country'] as $val) { if (!$this->{$val} || !is_string($this->{$val})) { throw InvoiceException::wrongType('non-empty string', $this->{$val}); } } }
/** * @throws InvoiceException */ private function validate() { if (!$this->currency || !is_string($this->currency)) { throw InvoiceException::wrongType('non-empty string', $this->currency); } if ($this->tax && !is_float($this->tax)) { throw InvoiceException::wrongType('float', $this->tax); } }
/** * Validates properties * * @throws InvoiceException */ private function validate() { if (!$this->accountNumber || !is_string($this->accountNumber)) { throw InvoiceException::wrongType('non-empty string', $this->accountNumber); } if ($this->iBan !== NULL && !$this->iBan || !is_string($this->iBan)) { throw InvoiceException::wrongType('non-empty string or null', $this->iBan); } if ($this->swift !== NULL && !$this->swift || !is_string($this->swift)) { throw InvoiceException::wrongType('non-empty string or null', $this->iBan); } }
/** * Validates properties * * @throws InvoiceException */ private function validate() { if (!$this->name || !is_string($this->name)) { throw InvoiceException::wrongType('non-empty string', $this->name); } if (!is_numeric($this->count)) { throw InvoiceException::wrongType('numeric', $this->count); } if (!is_numeric($this->price)) { throw InvoiceException::wrongType('numeric', $this->price); } }
/** * Validates properties * * @throws InvoiceException */ private function validate() { if (!$this->number || !is_string($this->number) || !is_numeric($this->number)) { throw InvoiceException::wrongType('non-empty string or numeric', $this->number); } }