Completed
Push — master ( c896df...0e1c32 )
by T
04:38
created

LevelMapping::getLevelForCode()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
3
namespace PHPSemVerChecker\Configuration;
4
5
use PHPSemVerChecker\SemanticVersioning\Level;
6
7
class LevelMapping
8
{
9
	public static $mapping = [
10
		'V001' => Level::MAJOR,
11
		'V002' => Level::MAJOR,
12
		'V003' => Level::MINOR,
13
		'V004' => Level::PATCH,
14
		'V005' => Level::MAJOR,
15
		'V006' => Level::MAJOR,
16
		'V007' => Level::MAJOR,
17
		'V008' => Level::MAJOR,
18
		'V009' => Level::MAJOR,
19
		'V010' => Level::MAJOR,
20
		'V011' => Level::MAJOR,
21
		'V012' => Level::MAJOR,
22
		'V013' => Level::MAJOR,
23
		'V014' => Level::MINOR,
24
		'V015' => Level::MAJOR,
25
		'V016' => Level::MAJOR,
26
		'V017' => Level::MINOR,
27
		'V018' => Level::MINOR,
28
		'V019' => Level::MAJOR,
29
		'V020' => Level::MAJOR,
30
		'V021' => Level::MINOR,
31
		'V022' => Level::PATCH,
32
		'V023' => Level::PATCH,
33
		'V024' => Level::PATCH,
34
		'V025' => Level::PATCH,
35
		'V026' => Level::PATCH,
36
		'V027' => Level::PATCH,
37
		'V028' => Level::PATCH,
38
		'V029' => Level::PATCH,
39
		'V030' => Level::PATCH,
40
		'V031' => Level::PATCH,
41
		'V032' => Level::MINOR,
42
		'V033' => Level::MAJOR,
43
		'V034' => Level::MAJOR,
44
		'V035' => Level::MAJOR,
45
		'V036' => Level::MAJOR,
46
		'V037' => Level::MAJOR,
47
		'V038' => Level::MAJOR,
48
		'V039' => Level::MAJOR,
49
		'V040' => Level::MAJOR,
50
		'V041' => Level::MAJOR,
51
		'V042' => Level::MAJOR,
52
		'V043' => Level::MAJOR,
53
		'V044' => Level::MAJOR,
54
		'V045' => Level::MAJOR,
55
		'V046' => Level::MINOR,
56
		'V047' => Level::MAJOR,
57
		'V048' => Level::MAJOR,
58
		'V049' => Level::MAJOR,
59
		'V050' => Level::MAJOR,
60
		'V052' => Level::PATCH,
61
		'V053' => Level::PATCH,
62
		'V054' => Level::PATCH,
63
		'V055' => Level::MAJOR,
64
		'V056' => Level::MAJOR,
65
		'V057' => Level::MAJOR,
66
		'V058' => Level::MAJOR,
67
		'V059' => Level::PATCH,
68
		'V060' => Level::PATCH,
69
		'V061' => Level::PATCH,
70
		'V062' => Level::PATCH,
71
		'V063' => Level::PATCH,
72
		'V064' => Level::PATCH,
73
		'V065' => Level::PATCH,
74
		'V066' => Level::PATCH,
75
		'V067' => Level::PATCH,
76
		'V068' => Level::MAJOR,
77
		'V069' => Level::MAJOR,
78
		'V070' => Level::MINOR,
79
		'V071' => Level::MINOR,
80
		'V072' => Level::MAJOR,
81
		'V073' => Level::MINOR,
82
		'V074' => Level::MAJOR,
83
		'V075' => Level::MAJOR,
84
		'V076' => Level::MAJOR,
85
		'V077' => Level::MINOR,
86
		'V078' => Level::MAJOR,
87
		'V079' => Level::MAJOR,
88
		'V082' => Level::MAJOR,
89
		'V083' => Level::MAJOR,
90
		'V084' => Level::PATCH,
91
		'V085' => Level::MAJOR,
92
		'V086' => Level::MAJOR,
93
		'V087' => Level::PATCH,
94
		'V088' => Level::MAJOR,
95
		'V089' => Level::MAJOR,
96
		'V090' => Level::PATCH,
97
		'V091' => Level::MINOR,
98
		'V092' => Level::MINOR,
99
		'V093' => Level::PATCH,
100
		'V094' => Level::MAJOR,
101
		'V095' => Level::MAJOR,
102
		'V096' => Level::PATCH,
103
		'V097' => Level::MAJOR,
104
		'V098' => Level::MAJOR,
105
		'V099' => Level::PATCH,
106
		'V100' => Level::MAJOR,
107
		'V101' => Level::MAJOR,
108
		'V102' => Level::MAJOR,
109
		'V103' => Level::MAJOR,
110
		'V104' => Level::MAJOR,
111
		'V105' => Level::MAJOR,
112
		'V106' => Level::MAJOR,
113
		'V107' => Level::MAJOR,
114
		'V108' => Level::MAJOR,
115
		'V109' => Level::MINOR,
116
		'V110' => Level::MINOR,
117
		'V111' => Level::MINOR,
118
		'V112' => Level::MAJOR,
119
		'V113' => Level::MAJOR,
120
		'V114' => Level::MAJOR,
121
		'V115' => Level::MAJOR,
122
		'V116' => Level::MAJOR,
123
		'V117' => Level::MAJOR,
124
	];
125
126 98
	public static function getLevelForCode($code)
127
	{
128 98
		return static::$mapping[$code];
129
	}
130
131
	public static function setOverrides(array $mapping)
132
	{
133
		foreach ($mapping as $code => $level) {
134
			static::$mapping[$code] = $level;
135
		}
136
	}
137
}
138