1 | <?php |
||
8 | class Debug extends Command |
||
9 | { |
||
10 | /** |
||
11 | * The name and signature of the console command. |
||
12 | * |
||
13 | * @var string |
||
14 | */ |
||
15 | protected $signature = 'winzou:state-machine:debug {graph? : A state machine graph}'; |
||
16 | |||
17 | /** |
||
18 | * The console command description. |
||
19 | * |
||
20 | * @var string |
||
21 | */ |
||
22 | protected $description = 'Show states and transitions of state machine graphs'; |
||
23 | |||
24 | protected $config; |
||
25 | |||
26 | /** |
||
27 | * Create a new command instance. |
||
28 | * |
||
29 | * @param array $config |
||
30 | */ |
||
31 | public function __construct(array $config) |
||
37 | |||
38 | /** |
||
39 | * Execute the console command. |
||
40 | * |
||
41 | * @return mixed |
||
42 | */ |
||
43 | public function handle() |
||
74 | |||
75 | /** |
||
76 | * Ask for a graph name if one was not provided as argument. |
||
77 | */ |
||
78 | protected function askForGraph() |
||
92 | |||
93 | /** |
||
94 | * Display the graph states on a table. |
||
95 | * |
||
96 | * @param array $states |
||
97 | */ |
||
98 | protected function printStates(array $states) |
||
121 | |||
122 | /** |
||
123 | * Display the graph transitions on a table. |
||
124 | * |
||
125 | * @param array $transitions |
||
126 | */ |
||
127 | protected function printTransitions(array $transitions) |
||
147 | |||
148 | /** |
||
149 | * Display the graph callbacks on a table. |
||
150 | * |
||
151 | * @param array $allCallbacks |
||
152 | */ |
||
153 | protected function printCallbacks(array $allCallbacks) |
||
169 | |||
170 | /** |
||
171 | * Format the clauses that satisfy the callback. |
||
172 | * |
||
173 | * @param array $specs |
||
174 | * @return string |
||
175 | */ |
||
176 | protected function formatSatisfies(array $specs) |
||
189 | |||
190 | /** |
||
191 | * Format the callback clause. |
||
192 | * |
||
193 | * @param array $specs |
||
194 | * @param string $clause |
||
195 | * @return string |
||
196 | */ |
||
197 | protected function formatClause(array $specs, $clause) |
||
205 | |||
206 | /** |
||
207 | * Format the callable callable. |
||
208 | * |
||
209 | * @param array $specs |
||
210 | * @return string |
||
211 | */ |
||
212 | protected function formatCallable(array $specs) |
||
244 | } |
||
245 |