Completed
Push — master ( 57472c...2e703a )
by Johan de
02:54
created

Address   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 38
ccs 8
cts 8
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getEmail() 0 4 1
A getName() 0 4 1
1
<?php declare(strict_types = 1);
0 ignored issues
show
Coding Style Compatibility introduced by
For compatibility and reusability of your code, PSR1 recommends that a file should introduce either new symbols (like classes, functions, etc.) or have side-effects (like outputting something, or including other files), but not both at the same time. The first symbol is defined on line 5 and the first side effect is on line 1.

The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.

The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.

To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.

Loading history...
2
3
namespace JDR\Mailer\Email;
4
5
class Address
6
{
7
    /**
8
     * @var string
9
     */
10
    private $email;
11
12
    /**
13
     * @var string
14
     */
15
    private $name;
16
17 11
    public function __construct(string $email, string $name = null)
18
    {
19 11
        $this->email = $email;
20 11
        $this->name = $name;
21 11
    }
22
23
    /**
24
     * Get email address.
25
     *
26
     * @return string
27
     */
28 2
    public function getEmail(): string
29
    {
30 2
        return $this->email;
31
    }
32
33
    /**
34
     * Get display name.
35
     *
36
     * @return string|null
37
     */
38 4
    public function getName()
39
    {
40 4
        return $this->name;
41
    }
42
}
43