Code Duplication    Length = 96-101 lines in 2 locations

src/jobs/JobExchangeCreate.php 1 location

@@ 12-112 (lines=101) @@
9
use mcorten87\rabbitmq_api\objects\QueueName;
10
use mcorten87\rabbitmq_api\objects\VirtualHost;
11
12
class JobExchangeCreate extends JobBase
13
{
14
    /**
15
     * @var VirtualHost
16
     */
17
    private $virtualHost;
18
19
    /**
20
     * @var ExchangeName
21
     */
22
    private $exchangeName;
23
24
    /**
25
     * @var bool
26
     */
27
    private $autoDelete = false;
28
29
    /**
30
     * @var bool
31
     */
32
    private $durable = true;
33
34
    /**
35
     * @var QueueArgument[]
36
     */
37
    private $arguments = [];
38
39
40
    /**
41
     * @param boolean $autoDelete
42
     */
43
    public function setAutoDelete($autoDelete)
44
    {
45
        $this->autoDelete = $autoDelete;
46
    }
47
48
    /**
49
     * @param boolean $durable
50
     */
51
    public function setDurable($durable)
52
    {
53
        $this->durable = $durable;
54
    }
55
56
    /**
57
     * @return \mcorten87\rabbitmq_api\objects\ExchangeArgument[]
58
     */
59
    public function getArguments()
60
    {
61
        return $this->arguments;
62
    }
63
64
    /**
65
     * @param ExchangeArgument $newArgument
66
     */
67
    public function addArgument(ExchangeArgument $argument)
68
    {
69
        $this->arguments[] = $argument;
70
    }
71
72
    /** @return VirtualHost */
73
    public function getVirtualHost() : VirtualHost
74
    {
75
        return $this->virtualHost;
76
    }
77
78
    /**
79
     * @return ExchangeName
80
     */
81
    public function getExchangeName()
82
    {
83
        return $this->exchangeName;
84
    }
85
86
    /**
87
     * @return boolean
88
     */
89
    public function isAutoDelete()
90
    {
91
        return $this->autoDelete;
92
    }
93
94
    /**
95
     * @return boolean
96
     */
97
    public function isDurable()
98
    {
99
        return $this->durable;
100
    }
101
102
    /**
103
     * JobExchangeCreate constructor.
104
     * @param VirtualHost $virtualHost
105
     * @param ExchangeName $exchangeName
106
     */
107
    public function __construct(VirtualHost $virtualHost, ExchangeName $exchangeName)
108
    {
109
        $this->virtualHost = $virtualHost;
110
        $this->exchangeName = $exchangeName;
111
    }
112
}
113

src/jobs/JobQueueCreate.php 1 location

@@ 9-104 (lines=96) @@
6
use mcorten87\rabbitmq_api\objects\QueueName;
7
use mcorten87\rabbitmq_api\objects\VirtualHost;
8
9
class JobQueueCreate extends JobBase
10
{
11
    /**
12
     * @var VirtualHost
13
     */
14
    private $virtualHost;
15
16
    /**
17
     * @var QueueName
18
     */
19
    private $queueName;
20
21
    /**
22
     * @var bool
23
     */
24
    private $autoDelete = false;
25
26
    /**
27
     * @var bool
28
     */
29
    private $durable = true;
30
31
    /**
32
     * @var QueueArgument[]
33
     */
34
    private $arguments = [];
35
36
37
    /**
38
     * @param boolean $autoDelete
39
     */
40
    public function setAutoDelete($autoDelete)
41
    {
42
        $this->autoDelete = $autoDelete;
43
    }
44
45
    /**
46
     * @param boolean $durable
47
     */
48
    public function setDurable($durable)
49
    {
50
        $this->durable = $durable;
51
    }
52
53
    /**
54
     * @return \mcorten87\rabbitmq_api\objects\QueueArgument[]
55
     */
56
    public function getArguments()
57
    {
58
        return $this->arguments;
59
    }
60
61
    /**
62
     * @param QueueArgument $newArgument
63
     */
64
    public function addArgument(QueueArgument $newArgument)
65
    {
66
        $this->arguments[] = $newArgument;
67
    }
68
69
    /** @return VirtualHost */
70
    public function getVirtualHost() : VirtualHost
71
    {
72
        return $this->virtualHost;
73
    }
74
75
    /**
76
     * @return QueueName
77
     */
78
    public function getQueueName()
79
    {
80
        return $this->queueName;
81
    }
82
83
    /**
84
     * @return boolean
85
     */
86
    public function isAutoDelete()
87
    {
88
        return $this->autoDelete;
89
    }
90
91
    /**
92
     * @return boolean
93
     */
94
    public function isDurable()
95
    {
96
        return $this->durable;
97
    }
98
99
    public function __construct(VirtualHost $virtualHost, QueueName $queueName)
100
    {
101
        $this->virtualHost = $virtualHost;
102
        $this->queueName = $queueName;
103
    }
104
}
105