Skip to content

Commit

Permalink
Fix: Extract private constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
localheinz committed Sep 22, 2020
1 parent b06a2e6 commit aae5dd9
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions test/Util/Scenario.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit aae5dd9

Please sign in to comment.