Completed
Push — master ( dc3001...f72a69 )
by Luc
44:07 queued 08:30
created

UpdateAddress   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 44
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 44
loc 44
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 9 9 1
A getAddress() 4 4 1
A getLanguage() 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
2
3
namespace CultuurNet\UDB3\Organizer\Commands;
4
5
use CultuurNet\UDB3\Address\Address;
6
use CultuurNet\UDB3\Language;
7
8 View Code Duplication
class UpdateAddress extends AbstractUpdateOrganizerCommand
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...
9
{
10
    /**
11
     * @var Address
12
     */
13
    private $address;
14
15
    /**
16
     * @var Language
17
     */
18
    private $language;
19
20
    /**
21
     * UpdateAddress constructor.
22
     * @param string $organizerId
23
     * @param Address $address
24
     * @param Language $language
25
     */
26
    public function __construct(
27
        $organizerId,
28
        Address $address,
29
        Language $language
30
    ) {
31
        parent::__construct($organizerId);
32
        $this->address = $address;
33
        $this->language = $language;
34
    }
35
36
    /**
37
     * @return Address
38
     */
39
    public function getAddress(): Address
40
    {
41
        return $this->address;
42
    }
43
44
    /**
45
     * @return Language
46
     */
47
    public function getLanguage(): Language
48
    {
49
        return $this->language;
50
    }
51
}
52