Skip to content

Commit

Permalink
Update MixedType.php
Browse files Browse the repository at this point in the history
  • Loading branch information
staabm committed Sep 9, 2024
1 parent 5e6c0c1 commit 0ce1914
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/Type/MixedType.php
Original file line number Diff line number Diff line change
Expand Up @@ -462,13 +462,8 @@ function () use ($level): string {

public function toBoolean(): BooleanType
{
if ($this->subtractedType !== null) {
if (StaticTypeFactory::falsey()->equals($this->subtractedType)) {
return new ConstantBooleanType(true);
}
if (StaticTypeFactory::truthy()->equals($this->subtractedType)) {
return new ConstantBooleanType(false);
}
if ($this->subtractedType !== null && StaticTypeFactory::falsey()->equals($this->subtractedType)) {
return new ConstantBooleanType(true);
}

return new BooleanType();
Expand Down

0 comments on commit 0ce1914

Please sign in to comment.