1 | <?php |
||
11 | class BackgroundColorManager extends AbstractColorManager |
||
12 | { |
||
13 | const BLACK = 'black'; |
||
14 | const RED = 'red'; |
||
15 | const GREEN = 'green'; |
||
16 | const YELLOW = 'yellow'; |
||
17 | const BLUE = 'blue'; |
||
18 | const PURPLE = 'purple'; |
||
19 | const CYAN = 'cyan'; |
||
20 | const WHITE = 'white'; |
||
21 | |||
22 | const BASH_BACKGROUND_BLACK = 40; |
||
23 | const BASH_BACKGROUND_RED = 41; |
||
24 | const BASH_BACKGROUND_GREEN = 42; |
||
25 | const BASH_BACKGROUND_YELLOW = 43; |
||
26 | const BASH_BACKGROUND_BLUE = 44; |
||
27 | const BASH_BACKGROUND_PURPLE = 45; |
||
28 | const BASH_BACKGROUND_CYAN = 46; |
||
29 | const BASH_BACKGROUND_WHITE = 47; |
||
30 | |||
31 | const BACKGROUND_COLOR_FUNCTION_NAME_REGEX = '^(back)_([a-zA-Z]*)$'; |
||
32 | |||
33 | /** |
||
34 | * Static calls interface to allow calls such as back_green('hello'); |
||
35 | */ |
||
36 | public static function __callstatic($name, $params) |
||
63 | |||
64 | /** |
||
65 | * Analyse function name |
||
66 | * |
||
67 | * @param string $functionName |
||
68 | * |
||
69 | * @return array|bool |
||
70 | */ |
||
71 | public static function isBackgroundCall($functionName) |
||
82 | |||
83 | /** |
||
84 | * Get allowed colors |
||
85 | * |
||
86 | * @return string[] |
||
87 | */ |
||
88 | public static function getKnownColors() |
||
103 | |||
104 | /** |
||
105 | * Get Color class |
||
106 | * |
||
107 | * @return string |
||
108 | */ |
||
109 | public static function getColorClass() |
||
113 | } |
||
114 |