This class seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate
the same code in three or more different places, we strongly encourage you to
look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.
Loading history...
11
{
12
/**
13
* @var UuidInterface
14
*/
15
protected $id;
16
17
/**
18
* The constructor.
19
* @param UuidInterface $id
20
*/
21
5
public function __construct(UuidInterface $id)
22
{
23
5
$this->id = $id;
24
5
}
25
26
/**
27
* Constructs the identifier from it's string representation.
28
* @param string $id
29
* @return static|UuidId
30
*/
31
1
public static function fromString(string $id): UuidId
32
{
33
1
return new static(Uuid::fromString($id));
34
}
35
36
/**
37
* {@inheritdoc}
38
*/
39
3
public function toString(): string
40
{
41
3
return $this->id->toString();
42
}
43
44
/**
45
* {@inheritdoc}
46
*/
47
3
public function isEqual(ValueObject $object): bool
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.