diff --git a/README.md b/README.md index 6dc2859..fdaed8f 100644 --- a/README.md +++ b/README.md @@ -172,7 +172,7 @@ class MyEntity implements RevisionableInterface return $this; } - public function getRevision(): RevisionInterface + public function getRevision(): ?RevisionInterface { return $this->revision; } diff --git a/UPGRADE-2.0.md b/UPGRADE-2.0.md index b484e4f..1638f82 100644 --- a/UPGRADE-2.0.md +++ b/UPGRADE-2.0.md @@ -15,7 +15,7 @@ UPGRADE FROM 1.x to 2.0 `RevisionFactoryInterface`. Any implementation of these interfaces must add matching return types: - `RevisionableInterface::setRevision()`: `static` (now fluent, must `return $this;`) - - `RevisionableInterface::getRevision()`: `RevisionInterface` + - `RevisionableInterface::getRevision()`: `?RevisionInterface` - `RevisionInterface::getUser()`: `?string` - `RevisionInterface::getCreatedAt()`: `\DateTimeInterface` - `RevisionFactoryInterface::createRevision()`: `RevisionInterface` (no longer diff --git a/src/RevisionableInterface.php b/src/RevisionableInterface.php index 7f63769..2eea3aa 100644 --- a/src/RevisionableInterface.php +++ b/src/RevisionableInterface.php @@ -14,7 +14,7 @@ interface RevisionableInterface public function setRevision(RevisionInterface $revision): static; /** - * Return the current revision + * Return the current revision, or null if there is none. */ - public function getRevision(): RevisionInterface; + public function getRevision(): ?RevisionInterface; }