-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathCity.php
More file actions
29 lines (23 loc) · 714 Bytes
/
Copy pathCity.php
File metadata and controls
29 lines (23 loc) · 714 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
namespace EricksonReyes\DomainDrivenDesign\Common\ValueObject\Address;
use EricksonReyes\DomainDrivenDesign\Common\Abstracts\SizeableAndMatchableString;
use EricksonReyes\DomainDrivenDesign\Common\ValueObject\Address\Exception\EmptyCityError;
/**
* Class City
* @package EricksonReyes\DomainDrivenDesign\Common\ValueObject\Address
*/
class City extends SizeableAndMatchableString
{
/**
* Name constructor.
* @param string $city
*/
public function __construct(string $city)
{
$trimmedCity = trim($city);
if ($trimmedCity === '') {
throw new EmptyCityError('City must not be empty.');
}
parent::__construct($trimmedCity);
}
}