diff --git a/test/Util/Scenario.php b/test/Util/Scenario.php index 7dc3e189..4c135f6a 100644 --- a/test/Util/Scenario.php +++ b/test/Util/Scenario.php @@ -25,14 +25,18 @@ final class Scenario */ private $initialState; - public static function fromCommandInvocationAndInitialState(CommandInvocation $commandInvocation, State $initialState): self + private function __construct(CommandInvocation $commandInvocation, State $initialState) { - $scenario = new self(); - - $scenario->commandInvocation = $commandInvocation; - $scenario->initialState = $initialState; + $this->commandInvocation = $commandInvocation; + $this->initialState = $initialState; + } - return $scenario; + public static function fromCommandInvocationAndInitialState(CommandInvocation $commandInvocation, State $initialState): self + { + return new self( + $commandInvocation, + $initialState + ); } public function directory(): Directory