Completed
Push — master ( 395fb2...b0764c )
by he
10:48 queued 10s
created

Language::allLanguages()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 1
c 1
b 0
f 1
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
namespace App;
4
5
class Language
6
{
7
    const LANG_C = 0;
8
    const LANG_CPP = 1;
9
    const LANG_JAVA = 2;
10
    const LANG_PAS = 3;
11
12
    private static $languages = [
13
        0 => 'C',
14
        1 => 'C++',
15
        2 => 'Java',
16
        3 => 'Pascal',
17
    ];
18
19
    public static function allLanguages()
20
    {
21
        return self::$languages;
22
    }
23
24
    public static function showLang($id)
25
    {
26
        return array_get(self::$languages, $id);
27
    }
28
}
29