Years::checkStart()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
3
namespace kalanis\simple_vin\Datasources;
4
5
6
use ArrayObject;
7
8
9
/**
10
 * @extends ArrayObject<string|int, int>
11
 */
12
final class Years extends ArrayObject
13
{
14 37
    public function __construct()
15
    {
16 37
        parent::__construct([
17 37
            'A' => 0,
18 37
            'B' => 1,
19 37
            'C' => 2,
20 37
            'D' => 3,
21 37
            'E' => 4,
22 37
            'F' => 5,
23 37
            'G' => 6,
24 37
            'H' => 7,
25 37
            'J' => 8,
26 37
            'K' => 9,
27 37
            'L' => 10,
28 37
            'M' => 11,
29 37
            'N' => 12,
30 37
            'P' => 13,
31 37
            'R' => 14,
32 37
            'S' => 15,
33 37
            'T' => 16,
34 37
            'V' => 17,
35 37
            'W' => 18,
36 37
            'X' => 19,
37 37
            'Y' => 20,
38 37
            '1' => 21,
39 37
            '2' => 22,
40 37
            '3' => 23,
41 37
            '4' => 24,
42 37
            '5' => 25,
43 37
            '6' => 26,
44 37
            '7' => 27,
45 37
            '8' => 28,
46 37
            '9' => 29,
47 37
        ]);
48
    }
49
50 16
    public function checkStart(int $passed): bool
51
    {
52 16
        return in_array($passed, [1980, 2010, 2040,]);
53
    }
54
}
55