Skip to content

Commit

Permalink
fix: replace instanceof ObjectType with TypeWithClassName
Browse files Browse the repository at this point in the history
  • Loading branch information
canvural committed Dec 22, 2022
1 parent e008b92 commit 40c8124
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Properties/ModelCastHelper.php
Expand Up @@ -21,6 +21,7 @@
use PHPStan\Type\StringType;
use PHPStan\Type\Type;
use PHPStan\Type\TypeCombinator;
use PHPStan\Type\TypeWithClassName;

class ModelCastHelper
{
Expand Down Expand Up @@ -112,7 +113,7 @@ public function getWriteableType(string $cast, Type $originalType): Type
$methodReflection = $classReflection->getNativeMethod('castUsing');
$castUsingReturn = ParametersAcceptorSelector::selectSingle($methodReflection->getVariants())->getReturnType();

if ($castUsingReturn instanceof ObjectType && $castReflection = $castUsingReturn->getClassReflection()) {
if ($castUsingReturn instanceof TypeWithClassName && $castReflection = $castUsingReturn->getClassReflection()) {
$classReflection = $castReflection;
}
}
Expand Down

0 comments on commit 40c8124

Please sign in to comment.