DirectConsumer   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 14
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A declareQueue() 0 8 1
1
<?php
2
3
/**
4
 * This file is part of amqp
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
 
10
declare(strict_types=1);
11
12
namespace Slick\Amqp\Consumer;
13
14
use Slick\Amqp\Consumer;
15
use Slick\Amqp\Consumer\BasicConsumer;
16
use Slick\Amqp\Producer;
17
18
/**
19
 * DirectConsumer
20
 *
21
 * @package Slick\Amqp\Consumer
22
 */
23
abstract class DirectConsumer extends BasicConsumer implements Consumer
24
{
25
26
    /**
27
     * @inheritDoc
28
     */
29
    protected function declareQueue(): void
30
    {
31
        $this->mergeExchangeOptions();
32
        $args = array_values($this->exchangeOptions());
33
        array_unshift($args, Producer::TYPE_DIRECT);
34
        array_unshift($args, $this->exchange);
35
        call_user_func_array([$this->channel(), 'exchange_declare'], $args);
36
        parent::declareQueue();
37
    }
38
}
39