Conditions | 4 |
Paths | 4 |
Total Lines | 27 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Tests | 11 |
CRAP Score | 4.1574 |
Changes | 1 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
21 | 2 | public function __construct(string $country, Date $date, string $title, string $language) |
|
22 | { |
||
23 | 2 | $country = trim($country); |
|
24 | |||
25 | 2 | if (empty($country)) { |
|
26 | throw HolidaysPhpException::notEmptyCountry(); |
||
27 | } |
||
28 | |||
29 | 2 | $title = trim($title); |
|
30 | |||
31 | 2 | if (empty($title)) { |
|
32 | throw HolidaysPhpException::notEmptyTitle(); |
||
33 | } |
||
34 | |||
35 | 2 | $language = trim($language); |
|
36 | |||
37 | 2 | if (empty($language)) { |
|
38 | throw HolidaysPhpException::notEmptyLanguage(); |
||
39 | } |
||
40 | |||
41 | 2 | $this->country = $country; |
|
42 | |||
43 | 2 | $this->date = $date->setTime(0, 0); |
|
44 | |||
45 | 2 | $this->title = $title; |
|
46 | |||
47 | 2 | $this->language = $language; |
|
48 | 2 | } |
|
50 |