Language::showLang()   A
last analyzed

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 1
dl 0
loc 3
rs 10
1
<?php
2
3
namespace App;
4
5
use Illuminate\Support\Arr;
6
7
class Language
8
{
9
    const LANG_C = 0;
10
    const LANG_CPP = 1;
11
    const LANG_PAS = 2;
12
    const LANG_JAVA = 3;
13
14
    private static $languages = [
15
        self::LANG_C    => 'C',
16
        self::LANG_CPP  => 'C++',
17
        self::LANG_JAVA => 'Java',
18
        self::LANG_PAS  => 'Pascal',
19
    ];
20
21
    public static function allLanguages()
22
    {
23
        return self::$languages;
24
    }
25
26
    public static function showLang($id)
27
    {
28
        return Arr::get(self::$languages, $id);
29
    }
30
}
31