Conditions | 5 |
Paths | 5 |
Total Lines | 19 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
29 | public function validate(): bool |
||
30 | { |
||
31 | if (!$this->dateTime instanceof DateTime) { |
||
|
|||
32 | throw Exception::invalidDatetime(); |
||
33 | } |
||
34 | |||
35 | if (!$this->orderDate instanceof DateTime) { |
||
36 | throw Exception::invalidOrderDate(); |
||
37 | } |
||
38 | |||
39 | if (strlen($this->reference) > 12) { |
||
40 | throw Exception::invalidReference($this->reference); |
||
41 | } |
||
42 | |||
43 | if (strlen($this->language) !== 2) { |
||
44 | throw Exception::invalidLanguage($this->language); |
||
45 | } |
||
46 | |||
47 | return true; |
||
48 | } |
||
50 |