@@ -236,32 +236,33 @@ private function check_dependencies(array $dependencies): bool
236236 return true ;
237237 }
238238
239- private const GITHUB_ACTIONS_TYPES = [
240- 0 => ['githubactions ' => false , 'githubactions_custom ' => false ], // No
241- 1 => ['githubactions ' => true , 'githubactions_custom ' => false ], // Reusable
242- 2 => ['githubactions ' => false , 'githubactions_custom ' => true ], // Standalone
243- ];
244-
245239 /**
246240 * Handle GitHub Actions specific logic
247241 */
248242 private function handle_github_actions (): void
249243 {
250- $ questionText = $ this ->language ->lang ('SKELETON_QUESTION_COMPONENT_GITHUBACTIONS ' ) . $ this ->language ->lang ('COLON ' );
244+ // Lookup table of GitHub Action component settings
245+ $ github_actions_types = [
246+ 0 => ['githubactions ' => false , 'githubactions_custom ' => false ], // No (default)
247+ 1 => ['githubactions ' => true , 'githubactions_custom ' => false ], // Reusable
248+ 2 => ['githubactions ' => false , 'githubactions_custom ' => true ], // Standalone
249+ ];
250+
251+ $ question_text = $ this ->language ->lang ('SKELETON_QUESTION_COMPONENT_GITHUBACTIONS ' ) . $ this ->language ->lang ('COLON ' );
251252 $ choices = [];
252- foreach (array_keys (self :: GITHUB_ACTIONS_TYPES ) as $ i )
253+ foreach (array_keys ($ github_actions_types ) as $ i )
253254 {
254255 $ choices [] = $ this ->language ->lang ('SKELETON_QUESTION_COMPONENT_GITHUBACTIONS_CLI ' , $ i );
255256 }
256257
257- $ question = new ChoiceQuestion ($ questionText , $ choices , 0 );
258+ $ question = new ChoiceQuestion ($ question_text , $ choices , 0 );
258259 $ choice = $ this ->helper ->ask ($ this ->input , $ this ->output , $ question );
259260 $ index = array_search ($ choice , $ choices , true );
260261
261- $ componentSettings = self :: GITHUB_ACTIONS_TYPES [$ index ] ?? self :: GITHUB_ACTIONS_TYPES [0 ];
262+ $ component_settings = $ github_actions_types [$ index ] ?? $ github_actions_types [0 ];
262263 $ this ->data ['components ' ] = array_merge (
263264 $ this ->data ['components ' ] ?? [],
264- $ componentSettings
265+ $ component_settings
265266 );
266267 }
267268}
0 commit comments