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

Carrier::instance()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 2
crap 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Kata\Domain\Carrier\Model;
6
7
use Kata\Domain\Carrier\ValueObject\CarrierId;
8
use Kata\Domain\Common\ValueObject\AggregateRoot;
9
10
class Carrier extends AggregateRoot
11
{
12
    /** @var string  */
13
    private $name;
14
15
    public function __construct(CarrierId $carrierId, string $name)
16
    {
17
        parent::__construct($carrierId);
18
        $this->name = $name;
19
    }
20
21
    public static function instance(CarrierId $carrierId, string $name): Carrier
22
    {
23
        return new self($carrierId, $name);
24
    }
25
}