Code Duplication    Length = 19-19 lines in 3 locations

module/CLI/src/Command/Shortcode/GenerateShortcodeCommand.php 1 location

@@ 60-78 (lines=19) @@
57
             ->addArgument('longUrl', InputArgument::REQUIRED, $this->translator->translate('The long URL to parse'));
58
    }
59
60
    public function interact(InputInterface $input, OutputInterface $output)
61
    {
62
        $longUrl = $input->getArgument('longUrl');
63
        if (! empty($longUrl)) {
64
            return;
65
        }
66
67
        /** @var QuestionHelper $helper */
68
        $helper = $this->getHelper('question');
69
        $question = new Question(sprintf(
70
            '<question>%s</question> ',
71
            $this->translator->translate('A long URL was not provided. Which URL do you want to shorten?:')
72
        ));
73
74
        $longUrl = $helper->ask($input, $output, $question);
75
        if (! empty($longUrl)) {
76
            $input->setArgument('longUrl', $longUrl);
77
        }
78
    }
79
80
    public function execute(InputInterface $input, OutputInterface $output)
81
    {

module/CLI/src/Command/Shortcode/GetVisitsCommand.php 1 location

@@ 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
    {

module/CLI/src/Command/Shortcode/ResolveUrlCommand.php 1 location

@@ 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
    {