Code Duplication    Length = 17-17 lines in 2 locations

src/Command/QueueBuildCommand.php 1 location

@@ 72-88 (lines=17) @@
69
        ;
70
    }
71
72
    protected function execute(InputInterface $input, OutputInterface $output)
73
    {
74
        $this->output = $output;
75
        $registry = $this->container->get('uecode_qpush');
76
77
        $name = $input->getArgument('name');
78
79
        if (null !== $name) {
80
            return $this->buildQueue($registry, $name);
81
        }
82
83
        foreach ($registry->all() as $queue) {
84
            $this->buildQueue($registry, $queue->getName());
85
        }
86
87
        return 0;
88
    }
89
90
    private function buildQueue($registry, $name)
91
    {

src/Command/QueueReceiveCommand.php 1 location

@@ 74-90 (lines=17) @@
71
        ;
72
    }
73
74
    protected function execute(InputInterface $input, OutputInterface $output)
75
    {
76
        $this->output = $output;
77
        $registry = $this->container->get('uecode_qpush');
78
79
        $name = $input->getArgument('name');
80
81
        if (null !== $name) {
82
            return $this->pollQueue($registry, $name);
83
        }
84
85
        foreach ($registry->all() as $queue) {
86
            $this->pollQueue($registry, $queue->getName());
87
        }
88
89
        return 0;
90
    }
91
92
    private function pollQueue($registry, $name)
93
    {