diff --git a/src/QueryReflection/QuerySimulation.php b/src/QueryReflection/QuerySimulation.php index c5e2107b..05a9997a 100644 --- a/src/QueryReflection/QuerySimulation.php +++ b/src/QueryReflection/QuerySimulation.php @@ -5,8 +5,6 @@ namespace staabm\PHPStanDba\QueryReflection; use PHPStan\ShouldNotHappenException; -use PHPStan\Type\Accessory\AccessoryType; -use PHPStan\Type\ArrayType; use PHPStan\Type\ConstantScalarType; use PHPStan\Type\ErrorType; use PHPStan\Type\IntersectionType; @@ -36,8 +34,8 @@ public static function simulateParamValueType(Type $paramType, bool $preparedPar return (string) $paramType->getValue(); } - if ($paramType instanceof ArrayType) { - return self::simulateParamValueType($paramType->getItemType(), $preparedParam); + if ($paramType->isArray()->yes()) { + return self::simulateParamValueType($paramType->getIterableValueType(), $preparedParam); } if ( @@ -92,19 +90,6 @@ public static function simulateParamValueType(Type $paramType, bool $preparedPar return null; } - if ($paramType instanceof IntersectionType) { - foreach ($paramType->getTypes() as $type) { - if ($type instanceof AccessoryType) { - continue; - } - - $simulated = self::simulateParamValueType($type, $preparedParam); - if (null !== $simulated) { - return $simulated; - } - } - } - // all types which we can't simulate and render a query unresolvable at analysis time if ($paramType instanceof MixedType || $paramType instanceof IntersectionType) { if (QueryReflection::getRuntimeConfiguration()->isDebugEnabled()) {