HeadersProducer   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A declareExchange() 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\Producer;
13
14
use Slick\Amqp\Producer;
15
use Slick\Amqp\Producer\BasicProducer;
16
17
/**
18
 * HeadersProducer
19
 *
20
 * @package Slick\Amqp\Producer
21
 */
22
abstract class HeadersProducer extends BasicProducer implements Producer
23
{
24
    /**
25
     * @inheritDoc
26
     */
27
    protected function declareExchange(): void
28
    {
29
        $this->mergeOptions();
30
        $args = array_values($this->options());
31
        array_unshift($args, self::TYPE_HEADERS);
32
        array_unshift($args, $this->exchange);
33
        call_user_func_array([$this->channel(), 'exchange_declare'], $args);
34
        $this->declared = true;
35
    }
36
}
37