Completed
Push — master ( 57dab7...a3bee9 )
by Tomáš
05:06
created

ExchangeBind   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 54
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 0
dl 54
loc 54
ccs 14
cts 14
cp 1
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 11 11 1
A getDestination() 4 4 1
A getRoutingKey() 4 4 1
A isNowait() 4 4 1
A getArguments() 4 4 1

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
<?php declare(strict_types=1);
2
3
namespace Portiny\RabbitMQ\Exchange;
4
5 View Code Duplication
final class ExchangeBind
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...
6
{
7
	/**
8
	 * @var string
9
	 */
10
	private $destination;
11
12
	/**
13
	 * @var string
14
	 */
15
	private $routingKey;
16
17
	/**
18
	 * @var bool
19
	 */
20
	private $nowait = false;
21
22
	/**
23
	 * @var array
24
	 */
25
	private $arguments = [];
26
27 4
	public function __construct(
28
		string $destination,
29
		string $routingKey = '',
30
		bool $nowait = false,
31
		array $arguments = []
32
	) {
33 4
		$this->destination = $destination;
34 4
		$this->routingKey = $routingKey;
35 4
		$this->nowait = $nowait;
36 4
		$this->arguments = $arguments;
37 4
	}
38
39 1
	public function getDestination(): string
40
	{
41 1
		return $this->destination;
42
	}
43
44 1
	public function getRoutingKey(): string
45
	{
46 1
		return $this->routingKey;
47
	}
48
49 1
	public function isNowait(): bool
50
	{
51 1
		return $this->nowait;
52
	}
53
54 1
	public function getArguments(): array
55
	{
56 1
		return $this->arguments;
57
	}
58
}
59