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) |
||
120 | |||
121 | /** |
||
122 | * Display the graph transitions on a table. |
||
123 | * |
||
124 | * @param array $transitions |
||
125 | */ |
||
126 | protected function printTransitions(array $transitions) |
||
146 | |||
147 | /** |
||
148 | * Display the graph callbacks on a table. |
||
149 | * |
||
150 | * @param array $allCallbacks |
||
151 | */ |
||
152 | protected function printCallbacks(array $allCallbacks) |
||
168 | |||
169 | /** |
||
170 | * Format the clauses that satisfy the callback. |
||
171 | * |
||
172 | * @param array $specs |
||
173 | * @return string |
||
174 | */ |
||
175 | protected function formatSatisfies(array $specs) |
||
188 | |||
189 | /** |
||
190 | * Format the callback clause. |
||
191 | * |
||
192 | * @param array $specs |
||
193 | * @param string $clause |
||
194 | * @return string |
||
195 | */ |
||
196 | protected function formatClause(array $specs, $clause) |
||
204 | |||
205 | /** |
||
206 | * Format the callable callable. |
||
207 | * |
||
208 | * @param array $specs |
||
209 | * @return string |
||
210 | */ |
||
211 | protected function formatCallable(array $specs) |
||
243 | } |
||
244 |