Completed
Push — Lonja/albertc ( 7a2bf6 )
by Albert
20:41 queued 16:20
created

City   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 21
ccs 0
cts 13
cp 0
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A instance() 0 4 1
A name() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Kata\Domain\City\Model;
6
7
use Kata\Domain\City\ValueObject\CityId;
8
use Kata\Domain\Common\ValueObject\AggregateRoot;
9
10
class City extends AggregateRoot
11
{
12
    /** @var string  */
13
    private $name;
14
15
    public function __construct(CityId $cityId, string $name)
16
    {
17
        parent::__construct($cityId);
18
        $this->name = $name;
19
    }
20
21
    public static function instance(CityId $cityId, string $name): City
22
    {
23
        return new self($cityId, $name);
24
    }
25
26
    public function  name(): string
27
    {
28
        return $this->name;
29
    }
30
}
31