diff --git a/src/Parsedown.php b/src/Parsedown.php index cda8a85..997b152 100644 --- a/src/Parsedown.php +++ b/src/Parsedown.php @@ -29,9 +29,9 @@ final class Parsedown public function __construct(StateBearer $StateBearer = null) { - $StateBearer = $StateBearer ?: new State; + $State = ($StateBearer ?? new State)->state(); - $this->State = $StateBearer->state()->isolatedCopy(); + $this->State = $State->isolatedCopy(); } /** diff --git a/src/State.php b/src/State.php index b48d401..532a287 100644 --- a/src/State.php +++ b/src/State.php @@ -102,10 +102,7 @@ final class State implements StateBearer ); } - /** - * @return State - */ - public function state() + public function state(): State { return $this; } diff --git a/src/StateBearer.php b/src/StateBearer.php index 9d2ce69..f0f9190 100644 --- a/src/StateBearer.php +++ b/src/StateBearer.php @@ -4,8 +4,5 @@ namespace Erusev\Parsedown; interface StateBearer { - /** - * @return State - */ - public function state(); + public function state(): State; }