Code Duplication    Length = 15-16 lines in 2 locations

PhpAmqpLib/Channel/AMQPChannel.php 2 locations

@@ 1374-1388 (lines=15) @@
1371
     *
1372
     * @param int $timeout Waits until $timeout value is reached
1373
     */
1374
    public function wait_for_pending_acks($timeout = 0)
1375
    {
1376
        $functions = array(
1377
            $this->waitHelper->get_wait('basic.ack'),
1378
            $this->waitHelper->get_wait('basic.nack'),
1379
        );
1380
1381
        while (count($this->published_messages) !== 0) {
1382
            if ($timeout > 0) {
1383
                $this->wait($functions, true, $timeout);
1384
            } else {
1385
                $this->wait($functions);
1386
            }
1387
        }
1388
    }
1389
1390
    /**
1391
     * Waits for pending acks, nacks and returns from the server. If there are no pending acks, the method returns immediately.
@@ 1395-1410 (lines=16) @@
1392
     *
1393
     * @param int $timeout If set to value > 0 the method will wait at most $timeout seconds for pending acks.
1394
     */
1395
    public function wait_for_pending_acks_returns($timeout = 0)
1396
    {
1397
        $functions = array(
1398
            $this->waitHelper->get_wait('basic.ack'),
1399
            $this->waitHelper->get_wait('basic.nack'),
1400
            $this->waitHelper->get_wait('basic.return'),
1401
        );
1402
1403
        while (count($this->published_messages) !== 0) {
1404
            if ($timeout > 0) {
1405
                $this->wait($functions, true, $timeout);
1406
            } else {
1407
                $this->wait($functions);
1408
            }
1409
        }
1410
    }
1411
1412
    /**
1413
     * Selects standard transaction mode