1 | <?php |
||
7 | abstract class Command |
||
8 | { |
||
9 | protected $args; |
||
10 | protected $outputFormatter; |
||
11 | |||
12 | public function __construct(Args $args, callable $outputFormatter) |
||
13 | { |
||
14 | $this->args = $args; |
||
15 | $this->outputFormatter = $outputFormatter; |
||
16 | } |
||
17 | |||
18 | abstract protected function run(); |
||
19 | |||
20 | public function __invoke() |
||
30 | |||
31 | /** |
||
32 | * @SuppressWarnings(PHPMD.BooleanArgumentFlag) |
||
33 | */ |
||
34 | protected function echoRaw($msg, $eol = true) |
||
45 | |||
46 | /** |
||
47 | * @SuppressWarnings(PHPMD.BooleanArgumentFlag) |
||
48 | */ |
||
49 | protected function echoError($msg, $eol = true) |
||
53 | |||
54 | /** |
||
55 | * @SuppressWarnings(PHPMD.BooleanArgumentFlag) |
||
56 | */ |
||
57 | protected function echoInfo($msg, $eol = true) |
||
61 | |||
62 | protected function echoNotes($notes) |
||
68 | } |
||
69 |