Passed
Branch master (1abd51)
by Mathijs
10:46
created

JobExchangeCreate::getArguments()   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\Exchange;
6
use mcorten87\rabbitmq_api\objects\ExchangeArgument;
7
use mcorten87\rabbitmq_api\objects\ExchangeName;
8
use mcorten87\rabbitmq_api\objects\QueueArgument;
9
use mcorten87\rabbitmq_api\objects\VirtualHost;
10
11 View Code Duplication
class JobExchangeCreate 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
     * @var ExchangeName
20
     */
21
    private $exchangeName;
22
23
    /**
24
     * @var bool
25
     */
26
    private $autoDelete = false;
27
28
    /**
29
     * @var bool
30
     */
31
    private $durable = true;
32
33
    /**
34
     * @var QueueArgument[]
35
     */
36
    private $arguments = [];
37
38
39
    /**
40
     * @param boolean $autoDelete
41
     */
42
    public function setAutoDelete($autoDelete)
43
    {
44
        $this->autoDelete = $autoDelete;
45
    }
46
47
    /**
48
     * @param boolean $durable
49
     */
50
    public function setDurable($durable)
51
    {
52
        $this->durable = $durable;
53
    }
54
55
    /**
56
     * @return \mcorten87\rabbitmq_api\objects\ExchangeArgument[]
57
     */
58
    public function getArguments()
59
    {
60
        return $this->arguments;
61
    }
62
63
    /**
64
     * @param ExchangeArgument $newArgument
0 ignored issues
show
Documentation introduced by
There is no parameter named $newArgument. Did you maybe mean $argument?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function. It has, however, found a similar but not annotated parameter which might be a good fit.

Consider the following example. The parameter $ireland is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $ireland
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was changed, but the annotation was not.

Loading history...
65
     */
66
    public function addArgument(ExchangeArgument $argument)
67
    {
68
        $this->arguments[] = $argument;
69
    }
70
71
    /** @return VirtualHost */
72
    public function getVirtualHost() : VirtualHost
73
    {
74
        return $this->virtualHost;
75
    }
76
77
    /**
78
     * @return ExchangeName
79
     */
80
    public function getExchangeName()
81
    {
82
        return $this->exchangeName;
83
    }
84
85
    /**
86
     * @return boolean
87
     */
88
    public function isAutoDelete()
89
    {
90
        return $this->autoDelete;
91
    }
92
93
    /**
94
     * @return boolean
95
     */
96
    public function isDurable()
97
    {
98
        return $this->durable;
99
    }
100
101
    /**
102
     * JobExchangeCreate constructor.
103
     * @param VirtualHost $virtualHost
104
     * @param ExchangeName $exchangeName
105
     */
106
    public function __construct(VirtualHost $virtualHost, ExchangeName $exchangeName)
107
    {
108
        $this->virtualHost = $virtualHost;
109
        $this->exchangeName = $exchangeName;
110
    }
111
}
112