99use Symfony \Component \Console \Input \InputInterface ;
1010use Symfony \Component \Console \Output \OutputInterface ;
1111use Symfony \Component \Console \Helper \ProgressBar ;
12- use Symfony \Component \Console \Completion \CompletionInput ;
13- use Symfony \Component \Console \Completion \CompletionSuggestions ;
1412use Team51 \Helper \Pressable_Connection_Helper ;
1513use function Team51 \Helper \get_pressable_site_by_id ;
1614use function Team51 \Helper \get_pressable_site_sftp_user_by_email ;
1715use function Team51 \Helper \run_app_command ;
1816use function Team51 \Helper \run_pressable_site_wp_cli_command ;
1917
2018class Create_Development_Site extends Command {
19+ use \Team51 \Helper \Autocomplete;
20+
2121 protected static $ defaultName = 'create-development-site ' ;
2222
2323 protected function configure () {
@@ -31,28 +31,6 @@ protected function configure() {
3131 ->addOption ( 'branch ' , null , InputOption::VALUE_REQUIRED , "The GitHub branch you would like to the development site to use. Defaults to 'develop'. " );
3232 }
3333
34- public function complete (CompletionInput $ input , CompletionSuggestions $ suggestions ): void {
35- $ args = $ input ->getArguments ();
36- $ arg_keys = array_keys ($ args );
37- foreach ( $ arg_keys as $ arg ) {
38- if ( ! in_array ($ arg , [ 'command ' ]) ) {
39- $ arg = '[ ' . $ arg . '] ' ;
40- $ suggestions ->suggestValue ( $ arg );
41- }
42- }
43-
44- $ options = $ input ->getOptions ();
45- $ opt_keys = array_keys ($ options );
46- foreach ( $ opt_keys as $ opt ) {
47- if ( ! in_array ($ opt , ['ansi ' , 'contractor ' , 'help ' , 'no-interaction ' , 'version ' , 'verbose ' , 'quiet ' , 'dev ' ]) ) {
48- $ opt = '-- ' . $ opt ;
49- $ suggestions ->suggestValue ( $ opt );
50- }
51- }
52-
53- $ suggestions ->suggestValue ( 'Example: team51 create-development-site --siteid=123 --label=issue-1234 --temporary-clone --skip-safety-net --branch=feature-branch ' . PHP_EOL );
54- }
55-
5634 protected function execute ( InputInterface $ input , OutputInterface $ output ) {
5735 $ api_helper = new API_Helper ();
5836
0 commit comments