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

Language   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 12
c 1
b 0
f 1
dl 0
loc 22
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A allLanguages() 0 3 1
A showLang() 0 3 1
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