ConfigLoader::region()   A
last analyzed

Complexity

Conditions 3
Paths 2

Size

Total Lines 11
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 3
eloc 5
nc 2
nop 0
dl 0
loc 11
rs 10
c 1
b 0
f 0
1
<?php
2
/* 
3
	Author: Irfa Ardiansyah <[email protected]>
4
*/
5
namespace Irfa\HariLibur\Core;
6
7
8
class ConfigLoader
9
{
10
	/**
11
     * Method ini berfungsi memuat file konfigurasi region.
12
     *
13
     * @return string
14
    */
15
	public function region()
16
	{
17
		if(file_exists(__DIR__.'../../../../../../config/irfa/hari_libur.php') && function_exists('app')){
18
19
			return strtoupper(config('irfa.hari_libur.region'));
0 ignored issues
show
Bug introduced by
The function config was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

19
			return strtoupper(/** @scrutinizer ignore-call */ config('irfa.hari_libur.region'));
Loading history...
20
21
		} else {
22
23
			require(__DIR__.'../../../config/hari_libur.php');
24
25
			return strtoupper($conf['region']);
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable $conf seems to be never defined.
Loading history...
26
		}
27
	}
28
}
29