Address::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SixtyEightPublishers\User\Common\Mail;
6
7
use Nette\SmartObject;
8
9
/**
10
 * @property-read string $email
11
 * @property-read NULL|string $name
12
 */
13
final class Address
14
{
15
	use SmartObject;
16
17
	/** @var string  */
18
	private $email;
19
20
	/** @var string|NULL  */
21
	private $name;
22
23
	/**
24
	 * @param string      $email
25
	 * @param string|NULL $name
26
	 */
27
	public function __construct(string $email, ?string $name = NULL)
28
	{
29
		$this->email = $email;
30
		$this->name = $name;
31
	}
32
33
	/**
34
	 * @return string
35
	 */
36
	public function getEmail(): string
37
	{
38
		return $this->email;
39
	}
40
41
	/**
42
	 * @return NULL|string
43
	 */
44
	public function getName(): ?string
45
	{
46
		return $this->name;
47
	}
48
}
49