Completed
Push — master ( 4a545c...9f7f98 )
by T
01:03
created

LevelMapping   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 152
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 33.33%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 0
dl 0
loc 152
ccs 2
cts 6
cp 0.3333
rs 10
c 0
b 0
f 0

2 Methods

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