| @@ 74-92 (lines=19) @@ | ||
| 71 | )); |
|
| 72 | } |
|
| 73 | ||
| 74 | public function interact(InputInterface $input, OutputInterface $output) |
|
| 75 | { |
|
| 76 | $longUrl = $input->getArgument('longUrl'); |
|
| 77 | if (! empty($longUrl)) { |
|
| 78 | return; |
|
| 79 | } |
|
| 80 | ||
| 81 | /** @var QuestionHelper $helper */ |
|
| 82 | $helper = $this->getHelper('question'); |
|
| 83 | $question = new Question(sprintf( |
|
| 84 | '<question>%s</question> ', |
|
| 85 | $this->translator->translate('A long URL was not provided. Which URL do you want to shorten?:') |
|
| 86 | )); |
|
| 87 | ||
| 88 | $longUrl = $helper->ask($input, $output, $question); |
|
| 89 | if (! empty($longUrl)) { |
|
| 90 | $input->setArgument('longUrl', $longUrl); |
|
| 91 | } |
|
| 92 | } |
|
| 93 | ||
| 94 | public function execute(InputInterface $input, OutputInterface $output) |
|
| 95 | { |
|
| @@ 61-79 (lines=19) @@ | ||
| 58 | ); |
|
| 59 | } |
|
| 60 | ||
| 61 | public function interact(InputInterface $input, OutputInterface $output) |
|
| 62 | { |
|
| 63 | $shortCode = $input->getArgument('shortCode'); |
|
| 64 | if (! empty($shortCode)) { |
|
| 65 | return; |
|
| 66 | } |
|
| 67 | ||
| 68 | /** @var QuestionHelper $helper */ |
|
| 69 | $helper = $this->getHelper('question'); |
|
| 70 | $question = new Question(sprintf( |
|
| 71 | '<question>%s</question> ', |
|
| 72 | $this->translator->translate('A short code was not provided. Which short code do you want to use?:') |
|
| 73 | )); |
|
| 74 | ||
| 75 | $shortCode = $helper->ask($input, $output, $question); |
|
| 76 | if (! empty($shortCode)) { |
|
| 77 | $input->setArgument('shortCode', $shortCode); |
|
| 78 | } |
|
| 79 | } |
|
| 80 | ||
| 81 | public function execute(InputInterface $input, OutputInterface $output) |
|
| 82 | { |
|
| @@ 46-64 (lines=19) @@ | ||
| 43 | ); |
|
| 44 | } |
|
| 45 | ||
| 46 | public function interact(InputInterface $input, OutputInterface $output) |
|
| 47 | { |
|
| 48 | $shortCode = $input->getArgument('shortCode'); |
|
| 49 | if (! empty($shortCode)) { |
|
| 50 | return; |
|
| 51 | } |
|
| 52 | ||
| 53 | /** @var QuestionHelper $helper */ |
|
| 54 | $helper = $this->getHelper('question'); |
|
| 55 | $question = new Question(sprintf( |
|
| 56 | '<question>%s</question> ', |
|
| 57 | $this->translator->translate('A short code was not provided. Which short code do you want to parse?:') |
|
| 58 | )); |
|
| 59 | ||
| 60 | $shortCode = $helper->ask($input, $output, $question); |
|
| 61 | if (! empty($shortCode)) { |
|
| 62 | $input->setArgument('shortCode', $shortCode); |
|
| 63 | } |
|
| 64 | } |
|
| 65 | ||
| 66 | public function execute(InputInterface $input, OutputInterface $output) |
|
| 67 | { |
|