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

JobExchangeDelete   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 38
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 38
loc 38
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
    public function getVirtualHost(): VirtualHost
27
    {
28
        return $this->virtualHost;
29
    }
30
31
    /**
32
     * @return ExchangeName
33
     */
34
    public function getExchangeName()
35
    {
36
        return $this->exchangeName;
37
    }
38
39
    /**
40
     * JobExchangeVirtualHostList constructor.
41
     * @param VirtualHost $virtualHost
42
     */
43
    public function __construct(VirtualHost $virtualHost, ExchangeName $exchangeName)
44
    {
45
        $this->virtualHost = $virtualHost;
46
        $this->exchangeName = $exchangeName;
47
    }
48
}
49