Code Duplication    Length = 82-83 lines in 4 locations

src/jobs/JobBindingToExchangeCreate.php 1 location

@@ 10-92 (lines=83) @@
7
use mcorten87\rabbitmq_api\objects\RoutingKey;
8
use mcorten87\rabbitmq_api\objects\VirtualHost;
9
10
class JobBindingToExchangeCreate extends JobBase
11
{
12
    /**
13
     * @var VirtualHost
14
     */
15
    private $virtualHost;
16
17
18
    /**
19
     * @var ExchangeName
20
     */
21
    private $exchange;
22
23
    /**
24
     * @var ExchangeName
25
     */
26
    private $toExchange;
27
28
    /**
29
     * @var DestinationType
30
     */
31
    private $destinationType;
32
33
    /**
34
     * @var RoutingKey
35
     */
36
    private $routingKey;
37
38
    /**
39
     * @return VirtualHost
40
     */
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 (string)$this->destinationType;
68
    }
69
70
    /**
71
     * @return mixed
72
     */
73
    public function getRoutingKey()
74
    {
75
        return $this->routingKey;
76
    }
77
78
    /**
79
     * JobBindingToExchangeCreate constructor.
80
     * @param VirtualHost $virtualHost
81
     * @param ExchangeName $exchange
82
     * @param ExchangeName $to
83
     * @param RoutingKey|null $routingKey
84
     */
85
    public function __construct(
86
        VirtualHost $virtualHost,
87
        ExchangeName $exchange,
88
        ExchangeName $to,
89
        RoutingKey $routingKey = null
90
    ) {
91
        $this->virtualHost = $virtualHost;
92
        $this->exchange = $exchange;
93
        $this->toExchange = $to;
94
95
        $this->destinationType = new DestinationType(DestinationType::EXCHANGE);

src/jobs/JobBindingToExchangeDelete.php 1 location

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

src/jobs/JobBindingToQueueCreate.php 1 location

@@ 11-93 (lines=83) @@
8
use mcorten87\rabbitmq_api\objects\RoutingKey;
9
use mcorten87\rabbitmq_api\objects\VirtualHost;
10
11
class JobBindingToQueueCreate extends JobBase
12
{
13
    /**
14
     * @var VirtualHost
15
     */
16
    private $virtualHost;
17
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 (string)$this->destinationType;
69
    }
70
71
    /**
72
     * @return RoutingKey
73
     */
74
    public function getRoutingKey()
75
    {
76
        return $this->routingKey;
77
    }
78
79
    /**
80
     * JobBindingToQueueCreate constructor.
81
     * @param VirtualHost $virtualHost
82
     * @param QueueName $queueName
83
     * @param ExchangeName $exchangeName
84
     * @param RoutingKey|null $routingKey
85
     */
86
    public function __construct(
87
        VirtualHost $virtualHost,
88
        QueueName $queueName,
89
        ExchangeName $exchangeName,
90
        RoutingKey $routingKey = null
91
    ) {
92
        $this->virtualHost = $virtualHost;
93
        $this->queueName = $queueName;
94
        $this->exchangeName = $exchangeName;
95
96
        $this->destinationType = new DestinationType(DestinationType::QUEUE);

src/jobs/JobBindingToQueueDelete.php 1 location

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