filterCountry()   A
last analyzed

Complexity

Conditions 6
Paths 6

Size

Total Lines 24
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 12
c 1
b 0
f 0
dl 0
loc 24
rs 9.2222
cc 6
nc 6
nop 1
1
0 ignored issues
show
Security Bug introduced by
It is not recommended to output anything before PHP's opening tag in non-template files.
Loading history...
2
<?php
3
4
use Bytesfield\SimpleKyc\SimpleKyc;
5
6
7
if (!function_exists('simple_kyc')) {
8
    function simple_kyc()
9
    {
10
        return new SimpleKyc();
11
    }
12
}
13
14
if (!function_exists('filterCountry')) {
15
    function filterCountry($country = null)
16
    {
17
        if ($country == null) {
18
            return 'NG';
19
        }
20
        $country = strtoupper($country);
21
22
        if ($country == 'NIGERIA') {
23
            return 'NG';
24
        }
25
26
        if ($country == 'GHANA') {
27
            return 'GH';
28
        }
29
30
        if ($country == 'KENYA') {
31
            return 'KE';
32
        }
33
34
        if ($country == 'UGANDA') {
35
            return 'UG';
36
        }
37
38
        return $country;
39
    }
40
}
41