Completed
Push — master ( 626bcc...764be1 )
by Mathijs
04:43 queued 04:43
created

JobBindingToExchangeDelete::getExchangeName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Importance

Changes 0
Metric Value
dl 4
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace mcorten87\rabbitmq_api\jobs;
4
5
use mcorten87\rabbitmq_api\objects\DestinationType;
6
use mcorten87\rabbitmq_api\objects\Exchange;
7
use mcorten87\rabbitmq_api\objects\ExchangeName;
8
use mcorten87\rabbitmq_api\objects\RoutingKey;
9
use mcorten87\rabbitmq_api\objects\VirtualHost;
10
11 View Code Duplication
class JobBindingToExchangeDelete extends JobBase
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
12
{
13
    /**
14
     * @var VirtualHost
15
     */
16
    private $virtualHost;
17
18
19
    /**
20
     * @var ExchangeName
21
     */
22
    private $exchange;
23
24
    /**
25
     * @var ExchangeName
26
     */
27
    private $toExchange;
28
29
    /**
30
     * @var DestinationType
31
     */
32
    private $destinationType;
33
34
    /**
35
     * @var RoutingKey
36
     */
37
    private $routingKey;
38
39
40
    /** @return VirtualHost */
41
    public function getVirtualHost() : VirtualHost
42
    {
43
        return $this->virtualHost;
44
    }
45
46
    /**
47
     * @return ExchangeName
48
     */
49
    public function getExchangeName()
50
    {
51
        return $this->exchange;
52
    }
53
54
    /**
55
     * @return ExchangeName
56
     */
57
    public function getToExchange(): ExchangeName
58
    {
59
        return $this->toExchange;
60
    }
61
62
    /**
63
     * @return string
64
     */
65
    public function getDestinationType(): string
66
    {
67
        return $this->destinationType;
68
    }
69
70
    /**
71
     * @return mixed
72
     */
73
    public function getRoutingKey()
74
    {
75
        return $this->routingKey;
76
    }
77
78
    /**
79
     * JobExchangeCreate constructor.
80
     * @param VirtualHost $virtualHost
81
     * @param ExchangeName $exchange
82
     */
83
    public function __construct(VirtualHost $virtualHost, ExchangeName $exchange, ExchangeName $to, RoutingKey $routingKey = null)
84
    {
85
        $this->virtualHost = $virtualHost;
86
        $this->exchange = $exchange;
87
        $this->toExchange = $to;
88
89
        $this->destinationType = new DestinationType(DestinationType::EXCHANGE);
90
        $this->routingKey = $routingKey !== null ? $routingKey : new RoutingKey('');
91
    }
92
}
93