Skip to content

Commit

Permalink
Fixed ConditionalType $subject type
Browse files Browse the repository at this point in the history
  • Loading branch information
vudaltsov committed Feb 23, 2024
1 parent 497e735 commit ed3f00d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/ConditionalType.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
final class ConditionalType implements Type
{
public function __construct(
private readonly Argument|TemplateType $subject,
private readonly Argument|Type $subject,
private readonly Type $if,
private readonly Type $then,
private readonly Type $else,
Expand Down
2 changes: 1 addition & 1 deletion src/DefaultTypeVisitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function closure(Type $type, array $parameters, ?Type $returnType): mixed
return $this->default($type);
}

public function conditional(Type $type, TemplateType|Argument $subject, Type $if, Type $then, Type $else): mixed
public function conditional(Type $type, Argument|Type $subject, Type $if, Type $then, Type $else): mixed
{
return $this->default($type);
}
Expand Down
2 changes: 1 addition & 1 deletion src/TypeVisitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public function closure(Type $type, array $parameters, ?Type $returnType): mixed
/**
* @return TReturn
*/
public function conditional(Type $type, Argument|TemplateType $subject, Type $if, Type $then, Type $else): mixed;
public function conditional(Type $type, Argument|Type $subject, Type $if, Type $then, Type $else): mixed;

/**
* @param non-empty-string $name
Expand Down
2 changes: 1 addition & 1 deletion src/types.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ public static function closure(array $parameters = [], ?Type $returnType = null)
);
}

public static function conditional(Argument|TemplateType $subject, Type $if, Type $then, Type $else): Type
public static function conditional(Argument|Type $subject, Type $if, Type $then, Type $else): Type
{
return new ConditionalType($subject, $if, $then, $else);
}
Expand Down

0 comments on commit ed3f00d

Please sign in to comment.