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) |
||
104 | |||
105 | /** |
||
106 | * Display the graph transitions on a table. |
||
107 | * |
||
108 | * @param array $transitions |
||
109 | */ |
||
110 | protected function printTransitions(array $transitions) |
||
130 | |||
131 | /** |
||
132 | * Display the graph callbacks on a table. |
||
133 | * |
||
134 | * @param array $allCallbacks |
||
135 | */ |
||
136 | protected function printCallbacks(array $allCallbacks) |
||
152 | |||
153 | protected function formatClause(array $callback, $clause) |
||
159 | |||
160 | /** |
||
161 | * Format the callable. |
||
162 | * |
||
163 | * @param callable $callable |
||
164 | * @return string |
||
165 | */ |
||
166 | protected function formatCallable($callable) |
||
178 | } |
||
179 |