ColourMap::get()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 4
rs 10
cc 2
eloc 3
nc 2
nop 2
1
<?php
2
namespace Sign;
3
4
class ColourMap {
5
    private static $_map = array(
6
        'black' => array(
7
            'black' => '00',
8
            'red' => '08',
9
            'green' => '10',
10
            'yellow' => '18'
11
        ),
12
        'red' => array(
13
            'black' => '08',//
14
            'red' => '08',//
15
            'green' => '08',//
16
            'yellow' => '19',
17
        ),
18
        'green' => array(
19
            'black' => '02',
20
            'red' => '08', //
21
            'green' => '08',//
22
            'yellow' => '08'//
23
        ),
24
        'yellow' => array(
25
            'black' => '08',//
26
            'red' => '0B',
27
            'green' => '08',//
28
            'yellow' => '08'//
29
        )
30
    );
31
32
    public static function get($fore, $back) {
33
        if (!isset(self::$_map[$back][$fore])) return '08';
34
        return self::$_map[$back][$fore];
35
    }
36
}