argument('user'); if($name === null) { //入力待ち $name = $this->ask('What is your name?'); } $this->info('hello, ' . $name); //yes / no 選択 if (!$this->confirm('Do you love BEER? [y|N]')) { $this->error('ERROR. EXIT.'); fputs(STDERR, 'ERROR'); return 1; } //選択リスト表示、選択 $beerChoice = null; while($beerChoice !== 'IPA') { $beerChoice = $this->choice('What kind?', ['Lager', 'IPA', 'Wheat', 'Pale Ale'], false); } //テーブル $header = ['Beer', 'Price']; $contents = [ ['PunkIPA', 650], ['Jack Hammer', 700], ['帝国IPA', 600], ['StoneIPA', 1000] ]; $this->table($header, $contents); //プログレスバー if ($this->confirm('Drink? [y|N]')) { system('say "Let\'s drink"'); $bar = $this->output->createProgressBar( count($contents) ); foreach($contents as $beer) { $bar->advance(); sleep(1); } $this->info(' Congrats!'); } } }