Skip to content

Commit e28fb5e

Browse files
committed
isSuperTypeOf() returns IsSuperTypeOfResult
1 parent 91239bd commit e28fb5e

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

src/DoctrineReflection/DoctrineResultObjectType.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Doctrine\DBAL\Result;
88
use PHPStan\ShouldNotHappenException;
99
use PHPStan\TrinaryLogic;
10+
use PHPStan\Type\IsSuperTypeOfResult;
1011
use PHPStan\Type\ObjectType;
1112
use PHPStan\Type\Type;
1213

@@ -51,10 +52,10 @@ public function equals(Type $type): bool
5152
return parent::equals($type);
5253
}
5354

54-
public function isSuperTypeOf(Type $type): TrinaryLogic
55+
public function isSuperTypeOf(Type $type): IsSuperTypeOfResult
5556
{
5657
if ($type instanceof self) {
57-
return TrinaryLogic::createFromBoolean(
58+
return IsSuperTypeOfResult::createFromBoolean(
5859
$type->rowType !== null
5960
&& $this->rowType !== null
6061
&& $type->rowType->equals($this->rowType)

src/DoctrineReflection/DoctrineStatementObjectType.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Doctrine\DBAL\Statement;
88
use PHPStan\ShouldNotHappenException;
99
use PHPStan\TrinaryLogic;
10+
use PHPStan\Type\IsSuperTypeOfResult;
1011
use PHPStan\Type\ObjectType;
1112
use PHPStan\Type\Type;
1213

@@ -51,10 +52,10 @@ public function equals(Type $type): bool
5152
return parent::equals($type);
5253
}
5354

54-
public function isSuperTypeOf(Type $type): TrinaryLogic
55+
public function isSuperTypeOf(Type $type): IsSuperTypeOfResult
5556
{
5657
if ($type instanceof self) {
57-
return TrinaryLogic::createFromBoolean(
58+
return IsSuperTypeOfResult::createFromBoolean(
5859
$type->rowType !== null
5960
&& $this->rowType !== null
6061
&& $type->rowType->equals($this->rowType)

src/QueryReflection/QueryReflection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ public function isResolvable(Expr $queryExpr, Scope $scope): TrinaryLogic
206206
}
207207
$isStringOrMixed = $type->isSuperTypeOf(new StringType());
208208

209-
return $isStringOrMixed->negate();
209+
return $isStringOrMixed->negate()->result;
210210
}
211211

212212
/**

0 commit comments

Comments
 (0)