Code Duplication    Length = 15-16 lines in 2 locations

PhpAmqpLib/Channel/AMQPChannel.php 2 locations

@@ 1341-1355 (lines=15) @@
1338
     *
1339
     * @param int $timeout Waits until $timeout value is reached
1340
     */
1341
    public function wait_for_pending_acks($timeout = 0)
1342
    {
1343
        $functions = array(
1344
            $this->waitHelper->get_wait('basic.ack'),
1345
            $this->waitHelper->get_wait('basic.nack'),
1346
        );
1347
1348
        while (count($this->published_messages) !== 0) {
1349
            if ($timeout > 0) {
1350
                $this->wait($functions, true, $timeout);
1351
            } else {
1352
                $this->wait($functions);
1353
            }
1354
        }
1355
    }
1356
1357
    /**
1358
     * Waits for pending acks, nacks and returns from the server. If there are no pending acks, the method returns immediately.
@@ 1362-1377 (lines=16) @@
1359
     *
1360
     * @param int $timeout If set to value > 0 the method will wait at most $timeout seconds for pending acks.
1361
     */
1362
    public function wait_for_pending_acks_returns($timeout = 0)
1363
    {
1364
        $functions = array(
1365
            $this->waitHelper->get_wait('basic.ack'),
1366
            $this->waitHelper->get_wait('basic.nack'),
1367
            $this->waitHelper->get_wait('basic.return'),
1368
        );
1369
1370
        while (count($this->published_messages) !== 0) {
1371
            if ($timeout > 0) {
1372
                $this->wait($functions, true, $timeout);
1373
            } else {
1374
                $this->wait($functions);
1375
            }
1376
        }
1377
    }
1378
1379
    /**
1380
     * Selects standard transaction mode