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

AggregateRoot   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 20
ccs 0
cts 12
cp 0
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A uuid() 0 4 1
A __toString() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Kata\Domain\Common\ValueObject;
6
7
abstract class AggregateRoot
8
{
9
    /** @var string */
10
    protected $uuid;
11
12
    protected function __construct(AggregateRootId $aggregateRootId)
13
    {
14
        $this->uuid = $aggregateRootId;
0 ignored issues
show
Documentation Bug introduced by
It seems like $aggregateRootId of type object<Kata\Domain\Commo...Object\AggregateRootId> is incompatible with the declared type string of property $uuid.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
15
    }
16
17
    public function uuid(): AggregateRootId
18
    {
19
        return $this->uuid;
20
    }
21
22
    public function __toString(): string
23
    {
24
        return (string) $this->uuid;
25
    }
26
}
27