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

AggregateRoot::uuid()   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 0
crap 2
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