1 | <?php |
||
10 | class SyntaxHighlighterConfig |
||
11 | { |
||
12 | const TYPE_KEYWORD = 'keyword'; |
||
13 | const TYPE_BRACE = 'brace'; |
||
14 | const TYPE_STRING = 'string'; |
||
15 | const TYPE_CONSTRUCT = 'construct'; |
||
16 | const TYPE_RETURN_NEW = 'return_new'; |
||
17 | const TYPE_VAR_DEREF = 'var_deref'; |
||
18 | const TYPE_CALL_PARENTHESIS = 'call_parenthesis'; |
||
19 | const TYPE_LHS = 'lhs'; |
||
20 | const TYPE_CLASS = 'class'; |
||
21 | const TYPE_OPEN_TAG = 'open_tag'; |
||
22 | |||
23 | /** |
||
24 | * @var array |
||
25 | */ |
||
26 | private $types = [ |
||
27 | self::TYPE_KEYWORD, |
||
28 | self::TYPE_BRACE, |
||
29 | self::TYPE_STRING, |
||
30 | self::TYPE_CONSTRUCT, |
||
31 | self::TYPE_RETURN_NEW , |
||
32 | self::TYPE_VAR_DEREF, |
||
33 | self::TYPE_CALL_PARENTHESIS, |
||
34 | self::TYPE_LHS, |
||
35 | self::TYPE_CLASS, |
||
36 | self::TYPE_OPEN_TAG, |
||
37 | ]; |
||
38 | |||
39 | /** |
||
40 | * @var array |
||
41 | */ |
||
42 | private $colors = [ |
||
43 | self::TYPE_KEYWORD => Colours::BLUE, |
||
44 | self::TYPE_BRACE => Colours::YELLOW, |
||
45 | self::TYPE_STRING => Colours::GREEN, |
||
46 | self::TYPE_CONSTRUCT => Colours::YELLOW, |
||
47 | self::TYPE_RETURN_NEW => Colours::LIGHT_MAGENTA, |
||
48 | self::TYPE_VAR_DEREF => Colours::GREEN, |
||
49 | self::TYPE_CALL_PARENTHESIS => Colours::LIGHT_GRAY, |
||
50 | self::TYPE_LHS => Colours::YELLOW, |
||
51 | self::TYPE_CLASS => Colours::LIGHT_GRAY, |
||
52 | self::TYPE_OPEN_TAG => Colours::CYAN, |
||
53 | ]; |
||
54 | |||
55 | /** |
||
56 | * @param array|null $colors |
||
57 | */ |
||
58 | public function __construct(array $colors = null) |
||
78 | |||
79 | /** |
||
80 | * @param string $type |
||
81 | * |
||
82 | * @return string |
||
83 | */ |
||
84 | public function getColorForType($type) |
||
93 | } |
||
94 |