Skip to content

Fix TypeError dead catch when assigning mixed to int in property #25701

Fix TypeError dead catch when assigning mixed to int in property

Fix TypeError dead catch when assigning mixed to int in property #25701

Triggered via pull request February 17, 2026 15:45
Status Failure
Total duration 14m 43s
Artifacts

tests.yml

on: pull_request
Matrix: Tests PHPUnit 12.x
Determine levels tests matrix
34s
Determine levels tests matrix
Matrix: Integration tests
Matrix: Tests PHPUnit 11.x
Matrix: Tests with old PHPUnit
Matrix: Mutation Testing
Matrix: Levels tests
Fit to window
Zoom out
Zoom in

Annotations

2 errors and 6 warnings
Mutation Testing (8.4, ubuntu-latest)
Process completed with exit code 1.
Mutation Testing (8.3, ubuntu-latest)
Process completed with exit code 1.
Mutation Testing (8.4, ubuntu-latest): src/Analyser/NodeScopeResolver.php#L6375
Escaped Mutant for Mutator "PHPStan\Infection\TrinaryLogicMutator": @@ @@ if (!$assignedTypeIsCompatible && !$assignedExprType instanceof MixedType) { foreach (TypeUtils::flattenTypes($assignedExprType->toCoercedArgumentType(true)) as $type) { $accepts = $propertyNativeType->accepts($type, true); - if ($accepts->yes()) { + if (!$accepts->no()) { $assignedTypeIsCompatible = true; continue; }
Mutation Testing (8.4, ubuntu-latest): src/Analyser/NodeScopeResolver.php#L6371
Escaped Mutant for Mutator "PHPStan\Infection\TrinaryLogicMutator": @@ @@ $nativeProperty = $declaringClass->getNativeProperty($propertyName); $propertyNativeType = $nativeProperty->getNativeType(); - $assignedTypeIsCompatible = $propertyNativeType->isSuperTypeOf($assignedExprType)->yes(); + $assignedTypeIsCompatible = !$propertyNativeType->isSuperTypeOf($assignedExprType)->no(); if (!$assignedTypeIsCompatible && !$assignedExprType instanceof MixedType) { foreach (TypeUtils::flattenTypes($assignedExprType->toCoercedArgumentType(true)) as $type) { $accepts = $propertyNativeType->accepts($type, true);
Mutation Testing (8.4, ubuntu-latest): src/Analyser/NodeScopeResolver.php#L6371
Escaped Mutant for Mutator "PHPStan\Infection\IsSuperTypeOfCalleeAndArgumentMutator": @@ @@ $nativeProperty = $declaringClass->getNativeProperty($propertyName); $propertyNativeType = $nativeProperty->getNativeType(); - $assignedTypeIsCompatible = $propertyNativeType->isSuperTypeOf($assignedExprType)->yes(); + $assignedTypeIsCompatible = $assignedExprType->isSuperTypeOf($propertyNativeType)->yes(); if (!$assignedTypeIsCompatible && !$assignedExprType instanceof MixedType) { foreach (TypeUtils::flattenTypes($assignedExprType->toCoercedArgumentType(true)) as $type) { $accepts = $propertyNativeType->accepts($type, true);
Mutation Testing (8.3, ubuntu-latest): src/Analyser/NodeScopeResolver.php#L6375
Escaped Mutant for Mutator "PHPStan\Infection\TrinaryLogicMutator": @@ @@ if (!$assignedTypeIsCompatible && !$assignedExprType instanceof MixedType) { foreach (TypeUtils::flattenTypes($assignedExprType->toCoercedArgumentType(true)) as $type) { $accepts = $propertyNativeType->accepts($type, true); - if ($accepts->yes()) { + if (!$accepts->no()) { $assignedTypeIsCompatible = true; continue; }
Mutation Testing (8.3, ubuntu-latest): src/Analyser/NodeScopeResolver.php#L6371
Escaped Mutant for Mutator "PHPStan\Infection\TrinaryLogicMutator": @@ @@ $nativeProperty = $declaringClass->getNativeProperty($propertyName); $propertyNativeType = $nativeProperty->getNativeType(); - $assignedTypeIsCompatible = $propertyNativeType->isSuperTypeOf($assignedExprType)->yes(); + $assignedTypeIsCompatible = !$propertyNativeType->isSuperTypeOf($assignedExprType)->no(); if (!$assignedTypeIsCompatible && !$assignedExprType instanceof MixedType) { foreach (TypeUtils::flattenTypes($assignedExprType->toCoercedArgumentType(true)) as $type) { $accepts = $propertyNativeType->accepts($type, true);
Mutation Testing (8.3, ubuntu-latest): src/Analyser/NodeScopeResolver.php#L6371
Escaped Mutant for Mutator "PHPStan\Infection\IsSuperTypeOfCalleeAndArgumentMutator": @@ @@ $nativeProperty = $declaringClass->getNativeProperty($propertyName); $propertyNativeType = $nativeProperty->getNativeType(); - $assignedTypeIsCompatible = $propertyNativeType->isSuperTypeOf($assignedExprType)->yes(); + $assignedTypeIsCompatible = $assignedExprType->isSuperTypeOf($propertyNativeType)->yes(); if (!$assignedTypeIsCompatible && !$assignedExprType instanceof MixedType) { foreach (TypeUtils::flattenTypes($assignedExprType->toCoercedArgumentType(true)) as $type) { $accepts = $propertyNativeType->accepts($type, true);