1 | <?php |
||
9 | class CommandTasks |
||
10 | { |
||
11 | /** |
||
12 | * @var \Illuminate\Console\OutputStyle |
||
13 | */ |
||
14 | protected $output; |
||
15 | |||
16 | /** |
||
17 | * @var array |
||
18 | */ |
||
19 | protected $results = []; |
||
20 | |||
21 | /** |
||
22 | * @var array |
||
23 | */ |
||
24 | protected $tasks = []; |
||
25 | |||
26 | /** |
||
27 | * @var bool |
||
28 | */ |
||
29 | protected $throwOnError = true; |
||
30 | |||
31 | /** |
||
32 | * Set command output. |
||
33 | * |
||
34 | * @param \Illuminate\Console\OutputStyle $output |
||
35 | * @return self |
||
36 | */ |
||
37 | public function setOutput(OutputStyle $output) : self |
||
43 | |||
44 | /** |
||
45 | * Add task with result to the stack. |
||
46 | * |
||
47 | * @param string $name |
||
48 | * @param callable $task |
||
49 | * @return self |
||
50 | */ |
||
51 | public function addTask(string $name, callable $task) : self |
||
57 | |||
58 | /** |
||
59 | * Send tasks to the command output. |
||
60 | * |
||
61 | * @return void |
||
62 | * |
||
63 | * @throws \Honeybadger\HoneybadgerLaravel\TaskFailed |
||
64 | */ |
||
65 | public function runTasks() : void |
||
84 | |||
85 | /** |
||
86 | * Get all task results. |
||
87 | * |
||
88 | * @return array |
||
89 | */ |
||
90 | public function getResults() : array |
||
94 | |||
95 | /** |
||
96 | * @return bool |
||
97 | */ |
||
98 | public function hasFailedTasks() : bool |
||
102 | |||
103 | /** |
||
104 | * @return self |
||
105 | */ |
||
106 | public function doNotThrowOnError() : self |
||
112 | } |
||
113 |