From 9749ef7a8eb48cae6ff153203c01f90be23bccfa Mon Sep 17 00:00:00 2001 From: Aidan Woods Date: Fri, 15 Oct 2021 23:23:14 +0100 Subject: [PATCH] Slightly nicer to allow construction from StateBearer --- src/State.php | 4 ++-- src/StateBearer.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/State.php b/src/State.php index d2a5ea7..efa9813 100644 --- a/src/State.php +++ b/src/State.php @@ -108,9 +108,9 @@ final class State implements StateBearer } /** @return self */ - public static function from(State $State) + public static function from(StateBearer $StateBearer) { - return $State; + return $StateBearer->state(); } public function isolatedCopy(): self diff --git a/src/StateBearer.php b/src/StateBearer.php index 8e64bef..f5580ec 100644 --- a/src/StateBearer.php +++ b/src/StateBearer.php @@ -6,5 +6,5 @@ interface StateBearer { public function state(): State; /** @return static */ - public static function from(State $State); + public static function from(StateBearer $StateBearer); }