Code Duplication    Length = 82-83 lines in 4 locations

src/jobs/JobBindingToExchangeCreate.php 1 location

@@ 11-93 (lines=83) @@
8
use mcorten87\rabbitmq_api\objects\RoutingKey;
9
use mcorten87\rabbitmq_api\objects\VirtualHost;
10
11
class JobBindingToExchangeCreate extends JobBase
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
     */
42
    public function getVirtualHost() : VirtualHost
43
    {
44
        return $this->virtualHost;
45
    }
46
47
    /**
48
     * @return ExchangeName
49
     */
50
    public function getExchangeName()
51
    {
52
        return $this->exchange;
53
    }
54
55
    /**
56
     * @return ExchangeName
57
     */
58
    public function getToExchange(): ExchangeName
59
    {
60
        return $this->toExchange;
61
    }
62
63
    /**
64
     * @return string
65
     */
66
    public function getDestinationType(): string
67
    {
68
        return $this->destinationType;
69
    }
70
71
    /**
72
     * @return mixed
73
     */
74
    public function getRoutingKey()
75
    {
76
        return $this->routingKey;
77
    }
78
79
    /**
80
     * JobExchangeCreate constructor.
81
     * @param VirtualHost $virtualHost
82
     * @param ExchangeName $exchange
83
     */
84
    public function __construct(VirtualHost $virtualHost, ExchangeName $exchange, ExchangeName $to, RoutingKey $routingKey = null)
85
    {
86
        $this->virtualHost = $virtualHost;
87
        $this->exchange = $exchange;
88
        $this->toExchange = $to;
89
90
        $this->destinationType = new DestinationType(DestinationType::EXCHANGE);
91
        $this->routingKey = $routingKey !== null ? $routingKey : new RoutingKey('');
92
    }
93
}
94

src/jobs/JobBindingToExchangeDelete.php 1 location

@@ 11-92 (lines=82) @@
8
use mcorten87\rabbitmq_api\objects\RoutingKey;
9
use mcorten87\rabbitmq_api\objects\VirtualHost;
10
11
class JobBindingToExchangeDelete extends JobBase
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

src/jobs/JobBindingToQueueCreate.php 1 location

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

src/jobs/JobBindingToQueueDelete.php 1 location

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