@@ -12,10 +12,10 @@ discard block |
||
| 12 | 12 | { |
| 13 | 13 | private $region; |
| 14 | 14 | /** |
| 15 | - * Method ini berfungsi untuk set tanggal dari config. |
|
| 16 | - * |
|
| 17 | - * @return boolean |
|
| 18 | - */ |
|
| 15 | + * Method ini berfungsi untuk set tanggal dari config. |
|
| 16 | + * |
|
| 17 | + * @return boolean |
|
| 18 | + */ |
|
| 19 | 19 | private function lang() |
| 20 | 20 | { |
| 21 | 21 | if(!empty($this->region)) |
@@ -32,10 +32,10 @@ discard block |
||
| 32 | 32 | $this->region = $region; |
| 33 | 33 | } |
| 34 | 34 | /** |
| 35 | - * Method ini berfungsi untuk mengambil data libur dari file json. |
|
| 36 | - * |
|
| 37 | - * @return boolean |
|
| 38 | - */ |
|
| 35 | + * Method ini berfungsi untuk mengambil data libur dari file json. |
|
| 36 | + * |
|
| 37 | + * @return boolean |
|
| 38 | + */ |
|
| 39 | 39 | public function holidayData($array = true) |
| 40 | 40 | { |
| 41 | 41 | $published_file = __DIR__.'../../../../../../resources/irfa/php-hari-libur/'.$this->lang().'.json'; |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | $arr = file_get_contents($file); |
| 51 | 51 | if($this->isJson($arr)) |
| 52 | 52 | { |
| 53 | - return json_decode($arr,$array); |
|
| 53 | + return json_decode($arr,$array); |
|
| 54 | 54 | } else{ |
| 55 | 55 | throw new \Exception('Json data is invalid.'); |
| 56 | 56 | |
@@ -58,10 +58,10 @@ discard block |
||
| 58 | 58 | } |
| 59 | 59 | } |
| 60 | 60 | /** |
| 61 | - * Method ini berfungsi untuk validasi json |
|
| 62 | - * |
|
| 63 | - * @return boolean |
|
| 64 | - */ |
|
| 61 | + * Method ini berfungsi untuk validasi json |
|
| 62 | + * |
|
| 63 | + * @return boolean |
|
| 64 | + */ |
|
| 65 | 65 | private function isJson($string) { |
| 66 | 66 | json_decode($string); |
| 67 | 67 | return (json_last_error() == JSON_ERROR_NONE); |
@@ -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; |