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) |
||
116 | |||
117 | /** |
||
118 | * Display the graph transitions on a table. |
||
119 | * |
||
120 | * @param array $transitions |
||
121 | */ |
||
122 | protected function printTransitions(array $transitions) |
||
142 | |||
143 | /** |
||
144 | * Display the graph callbacks on a table. |
||
145 | * |
||
146 | * @param array $allCallbacks |
||
147 | */ |
||
148 | protected function printCallbacks(array $allCallbacks) |
||
164 | |||
165 | /** |
||
166 | * Format the clauses that satisfy the callback. |
||
167 | * |
||
168 | * @param array $specs |
||
169 | * @return string |
||
170 | */ |
||
171 | protected function formatSatisfies(array $specs) |
||
184 | |||
185 | /** |
||
186 | * Format the callback clause. |
||
187 | * |
||
188 | * @param array $specs |
||
189 | * @param string $clause |
||
190 | * @return string |
||
191 | */ |
||
192 | protected function formatClause(array $specs, $clause) |
||
200 | |||
201 | /** |
||
202 | * Format the callable callable. |
||
203 | * |
||
204 | * @param array $specs |
||
205 | * @return string |
||
206 | */ |
||
207 | protected function formatCallable(array $specs) |
||
239 | } |
||
240 |