Passed
Push — master ( 304443...6a587c )
by
unknown
02:08
created

MangoPayConstants::getIncomeRangeFromId()   C

Complexity

Conditions 7
Paths 7

Size

Total Lines 27
Code Lines 23

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 27
rs 6.7272
c 0
b 0
f 0
cc 7
eloc 23
nc 7
nop 1
1
<?php
2
/**
3
 * Created by Graham Owens ([email protected])
4
 * Company: PartFire Ltd (www.partfire.co.uk)
5
 * Console: Discovery
6
 *
7
 * User:    gra
8
 * Date:    31/12/16
9
 * Time:    00:53
10
 * Project: fruitful-property-investments
11
 * File:    MangoPayConstants.php
12
 *
13
 **/
14
15
namespace PartFire\MangoPayBundle;
16
17
18
class MangoPayConstants
19
{
20
    // https://docs.mangopay.com/endpoints/v2/users#e254_the-natural-user-object
21
22
    public static function getIncomeRangeFromId(int $id) : string
23
    {
24
        switch ($id) {
25
            case 1:
26
                $range = "incomes <18K€";
27
                break;
28
            case 2:
29
                $range = "incomes between 18 and 30K€";
30
                break;
31
            case 3:
32
                $range = "incomes between 30 and 50K€";
33
                break;
34
            case 4:
35
                $range = "incomes between 50 and 80K€";
36
                break;
37
            case 5:
38
                $range = "incomes between 80 and 120K€";
39
                break;
40
            case 6:
41
                $range = "incomes>120K€";
42
                break;
43
            default:
44
                $range = "Unknown range";
45
        }
46
47
        return $range;
48
    }
49
}