Code Duplication    Length = 9-10 lines in 5 locations

PhpAmqpLib/Helper/Protocol/Protocol080.php 2 locations

@@ 285-294 (lines=10) @@
282
    /**
283
     * @return array
284
     */
285
    public function exchangeDeclare($ticket = 1, $exchange, $type = 'direct', $passive = false, $durable = false, $auto_delete = false, $internal = false, $nowait = false, $arguments = array())
286
    {
287
        $args = new AMQPWriter();
288
        $args->write_short($ticket);
289
        $args->write_shortstr($exchange);
290
        $args->write_shortstr($type);
291
        $args->write_bits(array($passive, $durable, $auto_delete, $internal, $nowait));
292
        $args->write_table(empty($arguments) ? array() : $arguments);
293
        return array(40, 10, $args);
294
    }
295
296
297
@@ 339-347 (lines=9) @@
336
    /**
337
     * @return array
338
     */
339
    public function queueDeclare($ticket = 1, $queue = '', $passive = false, $durable = false, $exclusive = false, $auto_delete = false, $nowait = false, $arguments = array())
340
    {
341
        $args = new AMQPWriter();
342
        $args->write_short($ticket);
343
        $args->write_shortstr($queue);
344
        $args->write_bits(array($passive, $durable, $exclusive, $auto_delete, $nowait));
345
        $args->write_table(empty($arguments) ? array() : $arguments);
346
        return array(50, 10, $args);
347
    }
348
349
350

PhpAmqpLib/Helper/Protocol/Protocol091.php 3 locations

@@ 283-292 (lines=10) @@
280
    /**
281
     * @return array
282
     */
283
    public function exchangeDeclare($ticket = 0, $exchange, $type = 'direct', $passive = false, $durable = false, $auto_delete = false, $internal = false, $nowait = false, $arguments = array())
284
    {
285
        $args = new AMQPWriter();
286
        $args->write_short($ticket);
287
        $args->write_shortstr($exchange);
288
        $args->write_shortstr($type);
289
        $args->write_bits(array($passive, $durable, $auto_delete, $internal, $nowait));
290
        $args->write_table(empty($arguments) ? array() : $arguments);
291
        return array(40, 10, $args);
292
    }
293
294
295
@@ 395-403 (lines=9) @@
392
    /**
393
     * @return array
394
     */
395
    public function queueDeclare($ticket = 0, $queue = '', $passive = false, $durable = false, $exclusive = false, $auto_delete = false, $nowait = false, $arguments = array())
396
    {
397
        $args = new AMQPWriter();
398
        $args->write_short($ticket);
399
        $args->write_shortstr($queue);
400
        $args->write_bits(array($passive, $durable, $exclusive, $auto_delete, $nowait));
401
        $args->write_table(empty($arguments) ? array() : $arguments);
402
        return array(50, 10, $args);
403
    }
404
405
406
@@ 562-571 (lines=10) @@
559
    /**
560
     * @return array
561
     */
562
    public function basicConsume($ticket = 0, $queue = '', $consumer_tag = '', $no_local = false, $no_ack = false, $exclusive = false, $nowait = false, $arguments = array())
563
    {
564
        $args = new AMQPWriter();
565
        $args->write_short($ticket);
566
        $args->write_shortstr($queue);
567
        $args->write_shortstr($consumer_tag);
568
        $args->write_bits(array($no_local, $no_ack, $exclusive, $nowait));
569
        $args->write_table(empty($arguments) ? array() : $arguments);
570
        return array(60, 20, $args);
571
    }
572
573
574