Code Duplication    Length = 9-10 lines in 5 locations

PhpAmqpLib/Helper/Protocol/Protocol080.php 4 locations

@@ 560-568 (lines=9) @@
557
    /**
558
     * @return array
559
     */
560
    public function basicPublish($ticket = 1, $exchange = '', $routing_key = '', $mandatory = false, $immediate = false)
561
    {
562
        $args = new AMQPWriter();
563
        $args->write_short($ticket);
564
        $args->write_shortstr($exchange);
565
        $args->write_shortstr($routing_key);
566
        $args->write_bits(array($mandatory, $immediate));
567
        return array(60, 40, $args);
568
    }
569
570
571
@@ 829-838 (lines=10) @@
826
    /**
827
     * @return array
828
     */
829
    public function filePublish($ticket = 1, $exchange = '', $routing_key = '', $mandatory = false, $immediate = false, $identifier)
830
    {
831
        $args = new AMQPWriter();
832
        $args->write_short($ticket);
833
        $args->write_shortstr($exchange);
834
        $args->write_shortstr($routing_key);
835
        $args->write_bits(array($mandatory, $immediate));
836
        $args->write_shortstr($identifier);
837
        return array(70, 60, $args);
838
    }
839
840
841
@@ 930-938 (lines=9) @@
927
    /**
928
     * @return array
929
     */
930
    public function streamConsume($ticket = 1, $queue = '', $consumer_tag = '', $no_local = false, $exclusive = false, $nowait = false)
931
    {
932
        $args = new AMQPWriter();
933
        $args->write_short($ticket);
934
        $args->write_shortstr($queue);
935
        $args->write_shortstr($consumer_tag);
936
        $args->write_bits(array($no_local, $exclusive, $nowait));
937
        return array(80, 20, $args);
938
    }
939
940
941
@@ 984-992 (lines=9) @@
981
    /**
982
     * @return array
983
     */
984
    public function streamPublish($ticket = 1, $exchange = '', $routing_key = '', $mandatory = false, $immediate = false)
985
    {
986
        $args = new AMQPWriter();
987
        $args->write_short($ticket);
988
        $args->write_shortstr($exchange);
989
        $args->write_shortstr($routing_key);
990
        $args->write_bits(array($mandatory, $immediate));
991
        return array(80, 40, $args);
992
    }
993
994
995

PhpAmqpLib/Helper/Protocol/Protocol091.php 1 location

@@ 617-625 (lines=9) @@
614
    /**
615
     * @return array
616
     */
617
    public function basicPublish($ticket = 0, $exchange = '', $routing_key = '', $mandatory = false, $immediate = false)
618
    {
619
        $args = new AMQPWriter();
620
        $args->write_short($ticket);
621
        $args->write_shortstr($exchange);
622
        $args->write_shortstr($routing_key);
623
        $args->write_bits(array($mandatory, $immediate));
624
        return array(60, 40, $args);
625
    }
626
627
628