Language   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

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

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
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