JobExchangeDelete   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 39
Duplicated Lines 97.44 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 38
loc 39
ccs 8
cts 8
cp 1
rs 10
c 1
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getVirtualHost() 4 4 1
A getExchangeName() 4 4 1
A __construct() 5 5 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
2
3
namespace mcorten87\rabbitmq_api\jobs;
4
5
use mcorten87\rabbitmq_api\objects\ExchangeName;
6
use mcorten87\rabbitmq_api\objects\VirtualHost;
7
8
/**
9
 * Lists the details of a specific exchange
10
 */
11 View Code Duplication
class JobExchangeDelete 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
     * @return VirtualHost
25
     */
26 3
    public function getVirtualHost(): VirtualHost
27
    {
28 3
        return $this->virtualHost;
29
    }
30
31
    /**
32
     * @return ExchangeName
33
     */
34 3
    public function getExchangeName()
35
    {
36 3
        return $this->exchangeName;
37
    }
38
39
    /**
40
     * JobExchangeDelete constructor.
41
     * @param VirtualHost $virtualHost
42
     * @param ExchangeName $exchangeName
43
     */
44 3
    public function __construct(VirtualHost $virtualHost, ExchangeName $exchangeName)
45
    {
46 3
        $this->virtualHost = $virtualHost;
47 3
        $this->exchangeName = $exchangeName;
48 3
    }
49
}
50