Code Duplication    Length = 14-24 lines in 3 locations

PhpAmqpLib/Channel/AMQPChannel.php 3 locations

@@ 387-410 (lines=24) @@
384
     * @param null $ticket
385
     * @return mixed|null
386
     */
387
    public function exchange_delete(
388
        $exchange,
389
        $if_unused = false,
390
        $nowait = false,
391
        $ticket = null
392
    ) {
393
        $ticket = $this->getTicket($ticket);
394
        list($class_id, $method_id, $args) = $this->protocolWriter->exchangeDelete(
395
            $ticket,
396
            $exchange,
397
            $if_unused,
398
            $nowait
399
        );
400
401
        $this->send_method_frame(array($class_id, $method_id), $args);
402
403
        if ($nowait) {
404
            return null;
405
        }
406
407
        return $this->wait(array(
408
            $this->waitHelper->get_wait('exchange.delete_ok')
409
        ));
410
    }
411
412
    /**
413
     * Confirms deletion of an exchange
@@ 700-714 (lines=15) @@
697
     * @param null $ticket
698
     * @return mixed|null
699
     */
700
    public function queue_purge($queue = '', $nowait = false, $ticket = null)
701
    {
702
        $ticket = $this->getTicket($ticket);
703
        list($class_id, $method_id, $args) = $this->protocolWriter->queuePurge($ticket, $queue, $nowait);
704
705
        $this->send_method_frame(array($class_id, $method_id), $args);
706
707
        if ($nowait) {
708
            return null;
709
        }
710
711
        return $this->wait(array(
712
            $this->waitHelper->get_wait('queue.purge_ok')
713
        ));
714
    }
715
716
    /**
717
     * Confirms a queue purge
@@ 846-859 (lines=14) @@
843
     * @param bool $noreturn
844
     * @return mixed
845
     */
846
    public function basic_cancel($consumer_tag, $nowait = false, $noreturn = false)
847
    {
848
        list($class_id, $method_id, $args) = $this->protocolWriter->basicCancel($consumer_tag, $nowait);
849
        $this->send_method_frame(array($class_id, $method_id), $args);
850
851
        if ($nowait || $noreturn) {
852
            unset($this->callbacks[$consumer_tag]);
853
            return $consumer_tag;
854
        }
855
856
        return $this->wait(array(
857
            $this->waitHelper->get_wait('basic.cancel_ok')
858
        ));
859
    }
860
861
    /**
862
     * @param AMQPReader $args