GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 95f711...5b62bb )
by Joost van
13s
created

Specialism::getAll()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 58
Code Lines 55

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 58
rs 9.639
cc 1
eloc 55
nc 1
nop 0

How to fix   Long Method   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
<?php
2
3
namespace Wb\BigRegister;
4
5
class Specialism
6
{
7
    public static function getAll()
8
    {
9
        return array(
10
            2 => 'Allergologie (allergoloog)',
11
            3 => 'Anesthesiologie (anesthesioloog)',
12
            4 => 'Huisartsgeneeskunde met apotheek (Apoth. Huisarts)',
13
            8 => 'Arbeid en gezond - bedrijfsgeneeskunde',
14
            10 => 'Cardiologie (cardioloog)',
15
            11 => 'Cardio-thoracale chirurgie',
16
            12 => 'Dermatologie en venerologie (dermatoloog)',
17
            13 => 'Maag-darm-leverziekten (maag-darm-leverarts)',
18
            14 => 'Heelkunde (chirurg)',
19
            15 => 'Huisartsgeneeskunde (huisarts)',
20
            16 => 'Interne geneeskunde (internist)',
21
            18 => 'Keel-, neus- en oorheelkunde (kno-arts)',
22
            19 => 'Kindergeneeskunde (kinderarts)',
23
            20 => 'Klinische chemie (arts klinische chemie)',
24
            21 => 'Klinische genetica (klinisch geneticus)',
25
            22 => 'Klinische geriatrie (klinisch geriater)',
26
            23 => 'Longziekten en tuberculose (longarts)',
27
            24 => 'Medische microbiologie (arts-microbioloog)',
28
            25 => 'Neurochirurgie (neurochirurg)',
29
            26 => 'Neurologie (neuroloog)',
30
            30 => 'Nucleaire geneeskunde (nucleair geneeskundige)',
31
            31 => 'Oogheelkunde (oogarts)',
32
            32 => 'Orthopedie (orthopeed)',
33
            33 => 'Pathologie (patholoog)',
34
            34 => 'Plastische chirurgie (plastisch chirurg)',
35
            35 => 'Psychiatrie (psychiater)',
36
            39 => 'Radiologie (radioloog)',
37
            40 => 'Radiotherapie (radiotherapeut)',
38
            41 => 'Reumatologie (reumatoloog)',
39
            42 => 'Revalidatiegeneeskunde (revalidatiearts)',
40
            43 => 'Maatschappij en gezondheid',
41
            45 => 'Urologie (uroloog)',
42
            46 => 'Obstetrie en gynaecologie (gynaecoloog)',
43
            47 => 'Specialisme ouderengeneeskunde',
44
            48 => 'Arbeid en gezondheid - verzekeringsgeneeskunde',
45
            50 => 'Zenuw- en zielsziekten (zenuwarts)',
46
            53 => 'Dento-maxillaire orthopaedie (orthodontist)',
47
            54 => 'Mondziekten en kaakchirurgie (kaakchirurg)',
48
            55 => 'Maatschappij en gezondheid',
49
            56 => 'Geneeskunde voor verstandelijk gehandicapten',
50
            60 => 'Ziekenhuisfarmacie (ziekenhuisapotheker)',
51
            61 => 'Klinische psychologie (klinisch psycholoog)',
52
            62 => 'Interne geneeskunde-allergologie',
53
            63 => 'Klinische neuropsychologie',
54
            65 => 'Verpl. spec. prev. zorg bij som. aandoeningen',
55
            66 => 'Verpl. spec. acute zorg bij som. aandoeningen',
56
            67 => 'Verpl. spec. intensieve zorg bij som. aandoeningen',
57
            68 => 'Verpl. spec. chronische zorg bij som. aandoeningen',
58
            69 => 'Verpl. spec. geestelijke gezondheidszorg',
59
            70 => 'Jeugdgezondheidszorg (Profiel KNMG Jeugdarts)',
60
            71 => 'Spoedeisendehulp (Profiel SEH Arts KNMG)',
61
            74 => 'Sportgeneeskunde',
62
            75 => 'Openbare Farmacie',
63
        );
64
    }
65
66
    public static function valueOf($name)
67
    {
68
        $list = self::getAll();
69
70
        $index = array_search($name, $list, true);
71
        return $index !== false ? $index : null;
72
    }
73
74
    public static function nameOf($value)
75
    {
76
        $list = self::getAll();
77
78
        if (array_key_exists($value, $list)) {
79
            return $list[$value];
80
        }
81
        return null;
82
    }
83
}
84