Skip to content

Commit

Permalink
Make constructors of Result child types protected
Browse files Browse the repository at this point in the history
It is not possible to call directly contructor
on a child type from outer context.
  • Loading branch information
piku235 committed Aug 21, 2021
1 parent a67e3ad commit 7944278
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Result.php
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ final class Ok extends Result
/**
* @param T $value
*/
public function __construct($value)
protected function __construct($value)
{
$this->value = $value;
}
Expand Down Expand Up @@ -314,7 +314,7 @@ final class Err extends Result
/**
* @param E $value
*/
public function __construct($value)
protected function __construct($value)
{
$this->value = $value;
}
Expand Down

0 comments on commit 7944278

Please sign in to comment.