Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
2 / 2 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
| StoredObject | |
100.00% |
2 / 2 |
|
100.00% |
2 / 2 |
2 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| isLatest | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace LambdaTwelve\OneRecord\Server\Spi; |
| 6 | |
| 7 | use DateTimeImmutable; |
| 8 | use LambdaTwelve\OneRecord\Model\LogisticsObject; |
| 9 | |
| 10 | /** |
| 11 | * One revision of a logistics object as the store holds it. |
| 12 | */ |
| 13 | final readonly class StoredObject |
| 14 | { |
| 15 | public function __construct( |
| 16 | public LogisticsObject $object, |
| 17 | public int $revision, |
| 18 | public int $latestRevision, |
| 19 | public DateTimeImmutable $createdAt, |
| 20 | public DateTimeImmutable $lastModified, |
| 21 | ) {} |
| 22 | |
| 23 | public function isLatest(): bool |
| 24 | { |
| 25 | return $this->revision === $this->latestRevision; |
| 26 | } |
| 27 | } |