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