-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestReadOnlyEntity.php
More file actions
44 lines (37 loc) · 970 Bytes
/
TestReadOnlyEntity.php
File metadata and controls
44 lines (37 loc) · 970 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
/*
* Copyright 2025 Cloud Creativity Limited
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
*/
declare(strict_types=1);
namespace CloudCreativity\Modules\Tests\Unit\Domain;
use CloudCreativity\Modules\Contracts\Domain\Entity;
use CloudCreativity\Modules\Contracts\Toolkit\Identifiers\Identifier;
use CloudCreativity\Modules\Domain\IsEntity;
/**
* @TODO remove when dropping PHP 8.1 and update `TestEntity` to be `readonly`.
*/
final readonly class TestReadOnlyEntity implements Entity
{
use IsEntity;
/**
* TestReadOnlyEntity constructor
*
* @param Identifier $id
* @param string $name
*/
public function __construct(Identifier $id, private string $name)
{
$this->id = $id;
}
/**
* @return string
*/
public function getName(): string
{
return $this->name;
}
}