-
Notifications
You must be signed in to change notification settings - Fork 2
/
VatCompany.php
64 lines (55 loc) · 1.36 KB
/
VatCompany.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
namespace AMBERSIVE\VatValidator\Classes;
class VatCompany
{
private ?String $countryCode = '';
private ?String $vatNumber = '';
private bool $valid;
private ?String $name = '';
private ?String $address = '';
public function __construct(object $data)
{
$this->countryCode = optional($data)->countryCode;
$this->vatNumber = optional($data)->vatNumber;
$this->valid = optional($data)->valid != null ? optional($data)->valid : false;
$this->name = optional($data, )->name;
$this->address = optional($data)->address;
}
/**
* Return the coutry code.
*
* @return string
*/
public function getCountry(): ?String
{
return $this->countryCode;
}
/**
* Returns the Vat ID / Number.
*/
public function getNumber(): ?String
{
return $this->vatNumber;
}
/**
* Returns if the VAT Id is valid.
*/
public function isValid():bool
{
return $this->valid;
}
/**
* Returns the name of the company which is associated with this vat id.
*/
public function getName(): ?String
{
return $this->name;
}
/**
* Returns the address of the company which is associated with this vat id.
*/
public function getAddress(): ?String
{
return $this->address;
}
}