Address   A
last analyzed

Complexity

Total Complexity 11

Size/Duplication

Total Lines 87
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 11
lcom 1
cbo 1
dl 0
loc 87
ccs 25
cts 25
cp 1
rs 10
c 0
b 0
f 0

8 Methods

Rating   Name   Duplication   Size   Complexity  
A getAddress() 0 4 1
A setType() 0 5 1
A setStreet1() 0 5 1
A setStreet2() 0 5 1
A setZip() 0 5 1
A setLocation() 0 5 1
A setCountry() 0 5 1
A isEmpty() 0 6 4
1
<?php
2
namespace Germania\Addresses;
3
4
class Address extends AddressAbstract implements AddressInterface, AddressProviderInterface
5
{
6
7
    /**
8
     * @inheritDoc
9
     */
10 10
    public function getAddress()  : ?AddressInterface
11
    {
12 10
        return $this;
13
    }
14
15
16
    /**
17
     * @param string $type|null
0 ignored issues
show
Bug introduced by
There is no parameter named $type|null. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

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

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

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

Loading history...
18
     * @return self Fluent interface
19
     */
20 14
    public function setType(?string $type)  : self
21
    {
22 14
        $this->type = $type;
23 14
        return $this;
24
    }
25
    
26
27
    /**
28
     * @param string $street1|null
0 ignored issues
show
Documentation introduced by
There is no parameter named $street1|null. Did you maybe mean $street1?

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...
29
     * @return self Fluent interface
30
     */
31 32
    public function setStreet1(?string $street1)  : self
32
    {
33 32
        $this->street1 = $street1;
34 32
        return $this;
35
    }
36
    
37
38
    /**
39
     * @param string $street2|null
0 ignored issues
show
Documentation introduced by
There is no parameter named $street2|null. Did you maybe mean $street2?

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...
40
     * @return self Fluent interface
41
     */
42 32
    public function setStreet2(?string $street2)  : self
43
    {
44 32
        $this->street2 = $street2;
45 32
        return $this;
46
    }
47
    
48
49
    /**
50
     * @param string $zip|null
0 ignored issues
show
Bug introduced by
There is no parameter named $zip|null. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

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

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

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

Loading history...
51
     * @return self Fluent interface
52
     */
53 32
    public function setZip(?string $zip)      : self
54
    {
55 32
        $this->zip = $zip;
56 32
        return $this;
57
    }
58
    
59
60
    /**
61
     * @param string $location|null
0 ignored issues
show
Documentation introduced by
There is no parameter named $location|null. Did you maybe mean $location?

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...
62
     * @return self Fluent interface
63
     */
64 32
    public function setLocation(?string $location) : self
65
    {
66 32
        $this->location = $location;
67 32
        return $this;
68
    }
69
    
70
71
    /**
72
     * @param string $country|null
0 ignored issues
show
Documentation introduced by
There is no parameter named $country|null. Did you maybe mean $country?

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...
73
     * @return self Fluent interface
74
     */
75 14
    public function setCountry(?string $country)  : self
76
    {
77 14
        $this->country = $country;
78 14
        return $this;
79
    }
80
81
    /**
82
     * @return inheritDoc
83
     */
84 20
    public function isEmpty() : bool {
85 20
        return (empty( trim($this->street1) )
86 20
           and empty( trim($this->street2) )
87 20
           and empty( trim($this->zip) )
88 20
           and empty( trim($this->location) ));
89
    }    
90
}
91