@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | */ |
19 | 19 | private function lang() |
20 | 20 | { |
21 | - if(!empty($this->region)) |
|
21 | + if (!empty($this->region)) |
|
22 | 22 | { |
23 | 23 | return strtoupper($this->region); |
24 | 24 | } |
@@ -39,19 +39,19 @@ discard block |
||
39 | 39 | public function holidayData($array = true) |
40 | 40 | { |
41 | 41 | $published_file = __DIR__.'../../../../../../resources/irfa/php-hari-libur/'.$this->lang().'.json'; |
42 | - if(file_exists($published_file)) |
|
42 | + if (file_exists($published_file)) |
|
43 | 43 | { |
44 | 44 | $file = $published_file; |
45 | - } else{ |
|
45 | + } else { |
|
46 | 46 | $file = __DIR__.'../../Data/'.$this->lang().'.json'; |
47 | 47 | } |
48 | 48 | |
49 | 49 | $this->checkFile($file); |
50 | 50 | $arr = file_get_contents($file); |
51 | - if($this->isJson($arr)) |
|
51 | + if ($this->isJson($arr)) |
|
52 | 52 | { |
53 | - return json_decode($arr,$array); |
|
54 | - } else{ |
|
53 | + return json_decode($arr, $array); |
|
54 | + } else { |
|
55 | 55 | throw new \Exception('Json data is invalid.'); |
56 | 56 | |
57 | 57 | return false; |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | |
70 | 70 | private function checkFile($file) |
71 | 71 | { |
72 | - if(!file_exists($file)) |
|
72 | + if (!file_exists($file)) |
|
73 | 73 | { |
74 | 74 | throw new \Exception('Region "'.$this->lang().'" is not found.'); |
75 | 75 | return false; |