ColourMap   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 2
c 2
b 0
f 0
lcom 1
cbo 0
dl 0
loc 33
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A get() 0 4 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
}