GarminFitSdkMapping::toInternal()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 10
c 0
b 0
f 0
ccs 0
cts 0
cp 0
cc 2
nc 2
nop 1
crap 6
1
<?php
2
3
/*
4
 * This file is part of the Runalyze Device List.
5
 *
6
 * (c) RUNALYZE <[email protected]>
7
 *
8
 * This source file is subject to the MIT license that is bundled
9
 * with this source code in the file LICENSE.
10
 */
11
12
namespace Runalyze\Devices\Mapping;
13
14
use Runalyze\Devices\Device\DeviceProfile;
15
16
class GarminFitSdkMapping
17
{
18
    /** @var int[]|string[] */
19
    protected $Mapping = [];
20
21 1
    protected function getMapping()
22
    {
23
        return [
24 1
            2962 => DeviceProfile::GARMIN_APPROACH_X_10,
25
            2266 => DeviceProfile::GARMIN_APPROACH_S_20,
26
            3049 => DeviceProfile::GARMIN_APPROACH_S_10,
27
            1936 => DeviceProfile::GARMIN_APPROACH_S_6,
28
            3085 => DeviceProfile::GARMIN_APPROACH_G_80,
29
            2292 => DeviceProfile::GARMIN_APPROACH_X_40,
30
            3314 => DeviceProfile::GARMIN_APPROACH_S_40,
31
            2656 => DeviceProfile::GARMIN_APPROACH_S_60,
32
            2907 => DeviceProfile::GARMIN_APPROACH_S_60,
33
            1405 => DeviceProfile::GARMIN_APPROACH_G_10,
34
            3700 => DeviceProfile::GARMIN_APPROACH_S_62,
35
            2859 => DeviceProfile::GARMIN_DESCENT_MK_1,
36
            2991 => DeviceProfile::GARMIN_DESCENT_MK_1,
37
            3258 => DeviceProfile::GARMIN_DESCENT_MK_2_I,
38
            2262 => DeviceProfile::GARMIN_D_2_BRAVO,
39
            2547 => DeviceProfile::GARMIN_D_2_BRAVO_TITANIUM,
40
            2819 => DeviceProfile::GARMIN_D_2_CHARLIE,
41
            3011 => DeviceProfile::GARMIN_EDGE_EXPLORE,
42
            2204 => DeviceProfile::GARMIN_EDGE_EXPLORE_1000,
43
            2531 => DeviceProfile::GARMIN_EDGE_EXPLORE_820,
44
            1736 => DeviceProfile::GARMIN_EDGE_TOURING,
45
            2238 => DeviceProfile::GARMIN_EDGE_20,
46
            2290 => DeviceProfile::GARMIN_EDGE_20,
47
            2147 => DeviceProfile::GARMIN_EDGE_25,
48
            2288 => DeviceProfile::GARMIN_EDGE_25,
49
            2289 => DeviceProfile::GARMIN_EDGE_25,
50
            3092 => DeviceProfile::GARMIN_EDGE_130,
51
            2909 => DeviceProfile::GARMIN_EDGE_130,
52
            3558 => DeviceProfile::GARMIN_EDGE_130_PLUS,
53
            1325 => DeviceProfile::GARMIN_EDGE_200,
54
            1555 => DeviceProfile::GARMIN_EDGE_200,
55
            1036 => DeviceProfile::GARMIN_EDGE_500,
56
            1387 => DeviceProfile::GARMIN_EDGE_500,
57
            1213 => DeviceProfile::GARMIN_EDGE_500,
58
            1422 => DeviceProfile::GARMIN_EDGE_500,
59
            1199 => DeviceProfile::GARMIN_EDGE_500,
60
            1561 => DeviceProfile::GARMIN_EDGE_510,
61
            1821 => DeviceProfile::GARMIN_EDGE_510,
62
            1742 => DeviceProfile::GARMIN_EDGE_510,
63
            1918 => DeviceProfile::GARMIN_EDGE_510,
64
            2067 => DeviceProfile::GARMIN_EDGE_520,
65
            2260 => DeviceProfile::GARMIN_EDGE_520,
66
            2261 => DeviceProfile::GARMIN_EDGE_520,
67
            3349 => DeviceProfile::GARMIN_EDGE_530,
68
            3121 => DeviceProfile::GARMIN_EDGE_530,
69
            1169 => DeviceProfile::GARMIN_EDGE_800,
70
            1386 => DeviceProfile::GARMIN_EDGE_800,
71
            1334 => DeviceProfile::GARMIN_EDGE_800,
72
            1497 => DeviceProfile::GARMIN_EDGE_800,
73
            1333 => DeviceProfile::GARMIN_EDGE_800,
74
            1567 => DeviceProfile::GARMIN_EDGE_810,
75
            1822 => DeviceProfile::GARMIN_EDGE_810,
76
            1721 => DeviceProfile::GARMIN_EDGE_810,
77
            1823 => DeviceProfile::GARMIN_EDGE_810,
78
            2530 => DeviceProfile::GARMIN_EDGE_820,
79
            2599 => DeviceProfile::GARMIN_EDGE_820,
80
            2600 => DeviceProfile::GARMIN_EDGE_820,
81
            2628 => DeviceProfile::GARMIN_EDGE_820,
82
            2629 => DeviceProfile::GARMIN_EDGE_820,
83
            2630 => DeviceProfile::GARMIN_EDGE_820,
84
            3122 => DeviceProfile::GARMIN_EDGE_830,
85
            3350 => DeviceProfile::GARMIN_EDGE_830,
86
            1836 => DeviceProfile::GARMIN_EDGE_1000,
87
            2070 => DeviceProfile::GARMIN_EDGE_1000,
88
            2053 => DeviceProfile::GARMIN_EDGE_1000,
89
            2100 => DeviceProfile::GARMIN_EDGE_1000,
90
            2052 => DeviceProfile::GARMIN_EDGE_1000,
91
            2274 => DeviceProfile::GARMIN_EDGE_1000,
92
            2713 => DeviceProfile::GARMIN_EDGE_1030,
93
            3095 => DeviceProfile::GARMIN_EDGE_1030,
94
            3570 => DeviceProfile::GARMIN_EDGE_1030_PLUS,
95
            2924 => DeviceProfile::GARMIN_EDGE_1030,
96
            3638 => DeviceProfile::GARMIN_ENDURO,
97
            1988 => DeviceProfile::GARMIN_EPIX,
98
            2332 => DeviceProfile::GARMIN_EPIX,
99
            2457 => DeviceProfile::GARMIN_EPIX,
100
            2140 => DeviceProfile::GARMIN_ETREX_TOUCH,
101
            1551 => DeviceProfile::GARMIN_FENIX,
102
            1967 => DeviceProfile::GARMIN_FENIX_2,
103
            2050 => DeviceProfile::GARMIN_FENIX_3,
104
            2188 => DeviceProfile::GARMIN_FENIX_3,
105
            2293 => DeviceProfile::GARMIN_FENIX_3,
106
            2407 => DeviceProfile::GARMIN_FENIX_3,
107
            2408 => DeviceProfile::GARMIN_FENIX_3,
108
            2189 => DeviceProfile::GARMIN_FENIX_3,
109
            2375 => DeviceProfile::GARMIN_FENIX_3,
110
            2432 => DeviceProfile::GARMIN_FENIX_3,
111
            2413 => DeviceProfile::GARMIN_FENIX_3_H_R,
112
            2473 => DeviceProfile::GARMIN_FENIX_3_H_R,
113
            2474 => DeviceProfile::GARMIN_FENIX_3_H_R,
114
            2475 => DeviceProfile::GARMIN_FENIX_3_H_R,
115
            2476 => DeviceProfile::GARMIN_FENIX_3_H_R,
116
            2477 => DeviceProfile::GARMIN_FENIX_3_H_R,
117
            2697 => DeviceProfile::GARMIN_FENIX_5,
118
            3110 => DeviceProfile::GARMIN_FENIX_5_PLUS,
119
            2796 => DeviceProfile::GARMIN_FENIX_5_WIFI,
120
            2797 => DeviceProfile::GARMIN_FENIX_5_S,
121
            2544 => DeviceProfile::GARMIN_FENIX_5_S,
122
            2604 => DeviceProfile::GARMIN_FENIX_5_X,
123
            2798 => DeviceProfile::GARMIN_FENIX_5_X,
124
            3089 => DeviceProfile::GARMIN_FENIX_5_X_PLUS,
125
            3135 => DeviceProfile::GARMIN_FENIX_5_X_PLUS,
126
            2900 => DeviceProfile::GARMIN_FENIX_5_S_PLUS,
127
            3134 => DeviceProfile::GARMIN_FENIX_5_S_PLUS,
128
            3111 => DeviceProfile::GARMIN_FENIX_5_X_PLUS,
129
            3112 => DeviceProfile::GARMIN_EDGE_520_PLUS,
130
            3142 => DeviceProfile::GARMIN_EDGE_520_PLUS,
131
            3287 => DeviceProfile::GARMIN_FENIX_6_S,
132
            3288 => DeviceProfile::GARMIN_FENIX_6_S_PRO,
133
            3289 => DeviceProfile::GARMIN_FENIX_6,
134
            3290 => DeviceProfile::GARMIN_FENIX_6_PRO,
135
            3291 => DeviceProfile::GARMIN_FENIX_6_X_PRO,
136
            3512 => DeviceProfile::GARMIN_FENIX_6_S,
137
            3513 => DeviceProfile::GARMIN_FENIX_6_S_PRO,
138
            3514 => DeviceProfile::GARMIN_FENIX_6,
139
            3515 => DeviceProfile::GARMIN_FENIX_6_PRO_SAPPHIRE,
140
            3516 => DeviceProfile::GARMIN_FENIX_6_X_SAPPHIRE,
141
            1482 => DeviceProfile::GARMIN_FORERUNNER_10,
142
            1688 => DeviceProfile::GARMIN_FORERUNNER_10,
143
            1903 => DeviceProfile::GARMIN_FORERUNNER_15,
144
            2061 => DeviceProfile::GARMIN_FORERUNNER_15,
145
            2148 => DeviceProfile::GARMIN_FORERUNNER_25,
146
            2891 => DeviceProfile::GARMIN_FORERUNNER_30,
147
            2977 => DeviceProfile::GARMIN_FORERUNNER_30,
148
            2503 => DeviceProfile::GARMIN_FORERUNNER_35,
149
            2650 => DeviceProfile::GARMIN_FORERUNNER_35,
150
            2667 => DeviceProfile::GARMIN_FORERUNNER_35,
151
            2668 => DeviceProfile::GARMIN_FORERUNNER_35,
152
            2814 => DeviceProfile::GARMIN_FORERUNNER_35,
153
            2727 => DeviceProfile::GARMIN_FORERUNNER_35,
154
            3469 => DeviceProfile::GARMIN_FORERUNNER_45,
155
            3282 => DeviceProfile::GARMIN_FORERUNNER_45_S,
156
            1436 => DeviceProfile::GARMIN_FORERUNNER_70,
157
            1124 => DeviceProfile::GARMIN_FORERUNNER_110,
158
            1274 => DeviceProfile::GARMIN_FORERUNNER_110,
159
            1360 => DeviceProfile::GARMIN_FORERUNNER_210,
160
            1632 => DeviceProfile::GARMIN_FORERUNNER_220,
161
            1631 => DeviceProfile::GARMIN_FORERUNNER_220,
162
            1931 => DeviceProfile::GARMIN_FORERUNNER_220,
163
            1930 => DeviceProfile::GARMIN_FORERUNNER_220,
164
            2073 => DeviceProfile::GARMIN_FORERUNNER_220,
165
            2174 => DeviceProfile::GARMIN_FORERUNNER_220,
166
            2153 => DeviceProfile::GARMIN_FORERUNNER_225,
167
            2219 => DeviceProfile::GARMIN_FORERUNNER_225,
168
            2313 => DeviceProfile::GARMIN_FORERUNNER_230,
169
            2157 => DeviceProfile::GARMIN_FORERUNNER_230,
170
            2431 => DeviceProfile::GARMIN_FORERUNNER_235,
171
            2396 => DeviceProfile::GARMIN_FORERUNNER_235,
172
            2733 => DeviceProfile::GARMIN_FORERUNNER_235,
173
            2397 => DeviceProfile::GARMIN_FORERUNNER_235,
174
            3144 => DeviceProfile::GARMIN_FORERUNNER_235,
175
            3076 => DeviceProfile::GARMIN_FORERUNNER_245,
176
            3145 => DeviceProfile::GARMIN_FORERUNNER_245,
177
            3321 => DeviceProfile::GARMIN_FORERUNNER_245_MUSIC,
178
            3077 => DeviceProfile::GARMIN_FORERUNNER_245_MUSIC,
179
            3913 => DeviceProfile::GARMIN_FORERUNNER_245_MUSIC,
180
            473 => DeviceProfile::GARMIN_FORERUNNER_301,
181
            474 => DeviceProfile::GARMIN_FORERUNNER_301,
182
            475 => DeviceProfile::GARMIN_FORERUNNER_301,
183
            494 => DeviceProfile::GARMIN_FORERUNNER_301,
184
            1018 => DeviceProfile::GARMIN_FORERUNNER_310_X_T,
185
            1446 => DeviceProfile::GARMIN_FORERUNNER_310_X_T,
186
            717 => DeviceProfile::GARMIN_FORERUNNER_405,
187
            987 => DeviceProfile::GARMIN_FORERUNNER_405,
188
            782 => DeviceProfile::GARMIN_FORERUNNER_50,
189
            988 => DeviceProfile::GARMIN_FORERUNNER_60,
190
            1345 => DeviceProfile::GARMIN_FORERUNNER_610,
191
            1410 => DeviceProfile::GARMIN_FORERUNNER_610,
192
            1623 => DeviceProfile::GARMIN_FORERUNNER_620,
193
            1929 => DeviceProfile::GARMIN_FORERUNNER_620,
194
            1928 => DeviceProfile::GARMIN_FORERUNNER_620,
195
            2072 => DeviceProfile::GARMIN_FORERUNNER_620,
196
            2173 => DeviceProfile::GARMIN_FORERUNNER_620,
197
            2156 => DeviceProfile::GARMIN_FORERUNNER_630,
198
            2310 => DeviceProfile::GARMIN_FORERUNNER_630,
199
            2311 => DeviceProfile::GARMIN_FORERUNNER_630,
200
            2886 => DeviceProfile::GARMIN_FORERUNNER_645,
201
            3003 => DeviceProfile::GARMIN_FORERUNNER_645,
202
            2888 => DeviceProfile::GARMIN_FORERUNNER_645_MUSIC,
203
            3004 => DeviceProfile::GARMIN_FORERUNNER_645_MUSIC,
204
            2158 => DeviceProfile::GARMIN_FORERUNNER_735_X_T,
205
            2533 => DeviceProfile::GARMIN_FORERUNNER_735_X_T,
206
            2534 => DeviceProfile::GARMIN_FORERUNNER_735_X_T,
207
            3589 => DeviceProfile::GARMIN_FORERUNNER_745,
208
            3794 => DeviceProfile::GARMIN_FORERUNNER_745,
209
            1328 => DeviceProfile::GARMIN_FORERUNNER_910_X_T,
210
            1537 => DeviceProfile::GARMIN_FORERUNNER_910_X_T,
211
            1600 => DeviceProfile::GARMIN_FORERUNNER_910_X_T,
212
            1664 => DeviceProfile::GARMIN_FORERUNNER_910_X_T,
213
            1765 => DeviceProfile::GARMIN_FORERUNNER_920_X_T,
214
            2131 => DeviceProfile::GARMIN_FORERUNNER_920_X_T,
215
            2132 => DeviceProfile::GARMIN_FORERUNNER_920_X_T,
216
            2130 => DeviceProfile::GARMIN_FORERUNNER_920_X_T,
217
            2691 => DeviceProfile::GARMIN_FORERUNNER_935,
218
            2833 => DeviceProfile::GARMIN_FORERUNNER_935,
219
            3113 => DeviceProfile::GARMIN_FORERUNNER_945,
220
            3441 => DeviceProfile::GARMIN_FORERUNNER_945,
221
            3126 => DeviceProfile::GARMIN_INSTINCT,
222
            3466 => DeviceProfile::GARMIN_INSTINCT_SOLAR,
223
            3498 => DeviceProfile::GARMIN_LEGACY_SAGA_REY,
224
            3499 => DeviceProfile::GARMIN_LEGACY_SAGA_DARTH_VADER,
225
            3809 => DeviceProfile::GARMIN_LILY,
226
            3420 => DeviceProfile::GARMIN_MARQ_DRIVER,
227
            3246 => DeviceProfile::GARMIN_MARQ_DRIVER,
228
            3421 => DeviceProfile::GARMIN_MARQ_AVIATOR,
229
            3247 => DeviceProfile::GARMIN_MARQ_AVIATOR,
230
            3248 => DeviceProfile::GARMIN_MARQ_CAPTAIN,
231
            3448 => DeviceProfile::GARMIN_MARQ_CAPTAIN,
232
            3249 => DeviceProfile::GARMIN_MARQ_COMMANDER,
233
            3449 => DeviceProfile::GARMIN_MARQ_COMMANDER,
234
            3250 => DeviceProfile::GARMIN_MARQ_ADVENTURER,
235
            3251 => DeviceProfile::GARMIN_MARQ_ATHLETE,
236
            3451 => DeviceProfile::GARMIN_MARQ_ATHLETE,
237
            3648 => DeviceProfile::GARMIN_MARQ_ADVENTURER,
238
            3624 => DeviceProfile::GARMIN_MARQ_ADVENTURER,
239
            3450 => DeviceProfile::GARMIN_MARQ_EXPEDITION,
240
            3459 => DeviceProfile::GARMIN_MONTANA_700,
241
            3500 => DeviceProfile::GARMIN_LEGACY_HERO_CAPTAIN_MARVEL,
242
            3501 => DeviceProfile::GARMIN_LEGACY_HERO_FIRST_AVENGER,
243
            3536 => DeviceProfile::GARMIN_LEGACY_HERO_FIRST_AVENGER,
244
            2512 => DeviceProfile::GARMIN_OREGON_700,
245
            1499 => DeviceProfile::GARMIN_SWIM,
246
            3405 => DeviceProfile::GARMIN_SWIM_2,
247
            3639 => DeviceProfile::GARMIN_SWIM_2,
248
            3226 => DeviceProfile::GARMIN_VENU,
249
            3596 => DeviceProfile::GARMIN_VENU_SQ,
250
            3600 => DeviceProfile::GARMIN_VENU_SQ,
251
            3737 => DeviceProfile::GARMIN_VENU_DAIMLER,
252
            3740 => DeviceProfile::GARMIN_VENU_DAIMLER,
253
            1907 => DeviceProfile::GARMIN_VIVO_ACTIVE,
254
            2160 => DeviceProfile::GARMIN_VIVO_ACTIVE,
255
            2337 => DeviceProfile::GARMIN_VIVO_ACTIVE_H_R,
256
            2497 => DeviceProfile::GARMIN_VIVO_ACTIVE_H_R,
257
            2976 => DeviceProfile::GARMIN_VIVO_ACTIVE_3,
258
            3473 => DeviceProfile::GARMIN_VIVO_ACTIVE_3,
259
            2700 => DeviceProfile::GARMIN_VIVO_ACTIVE_3,
260
            3446 => DeviceProfile::GARMIN_VIVO_ACTIVE_3,
261
            2988 => DeviceProfile::GARMIN_VIVO_ACTIVE_3_MUSIC,
262
            3163 => DeviceProfile::GARMIN_VIVO_ACTIVE_3_MUSIC,
263
            3066 => DeviceProfile::GARMIN_VIVO_ACTIVE_3_MUSIC,
264
            3225 => DeviceProfile::GARMIN_VIVO_ACTIVE_4,
265
            3388 => DeviceProfile::GARMIN_VIVO_ACTIVE_4,
266
            3389 => DeviceProfile::GARMIN_VIVO_ACTIVE_4,
267
            3224 => DeviceProfile::GARMIN_VIVO_ACTIVE_4_S,
268
            3387 => DeviceProfile::GARMIN_VIVO_ACTIVE_4_S,
269
            1837 => DeviceProfile::GARMIN_VIVO_FIT,
270
            2606 => DeviceProfile::GARMIN_VIVO_FIT_JR,
271
            2150 => DeviceProfile::GARMIN_VIVO_FIT_2,
272
            2406 => DeviceProfile::GARMIN_VIVO_FIT_3,
273
            2368 => DeviceProfile::GARMIN_VIVO_MOVE,
274
            3422 => DeviceProfile::GARMIN_VIVO_MOVE_3,
275
            2772 => DeviceProfile::GARMIN_VIVO_MOVE_H_R,
276
            2945 => DeviceProfile::GARMIN_VIVO_MOVE_H_R,
277
            3378 => DeviceProfile::GARMIN_VIVO_MOVE_3_S,
278
            3308 => DeviceProfile::GARMIN_VIVO_MOVE_LUXE,
279
            2623 => DeviceProfile::GARMIN_VIVO_SPORT,
280
            2832 => DeviceProfile::GARMIN_VIVO_SPORT,
281
            1956 => DeviceProfile::GARMIN_VIVO_SMART,
282
            2135 => DeviceProfile::GARMIN_VIVO_SMART,
283 1
            2294 => DeviceProfile::GARMIN_VIVO_SMART,
284
            2271 => DeviceProfile::GARMIN_VIVO_SMART_2,
285 1
            2831 => DeviceProfile::GARMIN_VIVO_SMART_3,
286 1
            2622 => DeviceProfile::GARMIN_VIVO_SMART_3,
287
            2927 => DeviceProfile::GARMIN_VIVO_SMART_4,
288
            3218 => DeviceProfile::GARMIN_VIVO_SMART_4,
289
            2347 => DeviceProfile::GARMIN_VIVO_SMART_GPS_H_R,
290
            2362 => DeviceProfile::GARMIN_VIVO_SMART_GPS_H_R,
291
            2348 => DeviceProfile::GARMIN_VIVO_SMART_H_R,
292 1
            2361 => DeviceProfile::GARMIN_VIVO_SMART_H_R,
293
            3273 => DeviceProfile::GARMIN_INSTINCT,
294 1
            3192 => DeviceProfile::GARMIN_SPEED_SENSOR_2,
295 1
            1438 => DeviceProfile::GARMIN_FIT_ANDROID,
296
            1439 => DeviceProfile::GARMIN_FIT_IPHONE,
297
        ];
298 1
    }
299
300
    //3765 => fenix 6s Pro Solar
301
302
    public function __construct()
303
    {
304
        $this->Mapping = $this->getMapping();
0 ignored issues
show
Documentation Bug introduced by
It seems like $this->getMapping() of type array<integer,?> is incompatible with the declared type array<integer,integer|string> of property $Mapping.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
305
    }
306
307
    /**
308
     * @param  int|string $value
309
     * @return int|string
310
     */
311
    public function toInternal($value)
312
    {
313
        if (isset($this->Mapping[$value])) {
314
            return $this->Mapping[$value];
315
        }
316
317
        return;
318
    }
319
}
320