1 | <?php |
||
13 | abstract class Command |
||
14 | { |
||
15 | |||
16 | const SUCCESS = 'success'; |
||
17 | |||
18 | const ERROR = 'error'; |
||
19 | |||
20 | private static $severityColors = [ |
||
21 | self::SUCCESS => 'green', |
||
22 | self::ERROR => 'red', |
||
23 | ]; |
||
24 | |||
25 | |||
26 | /** |
||
27 | * Trigger an error and ends execution (if not catched) |
||
28 | * @param $message |
||
29 | * @throws ErrorException |
||
30 | */ |
||
31 | 5 | protected function error($message) |
|
35 | |||
36 | |||
37 | 9 | protected function log($message, $severity = NULL) |
|
42 | |||
43 | } |