Skip to content

Fix phpstan/phpstan#11488: Wrongly assumed undefined variable since 1.11.10 #26497

Fix phpstan/phpstan#11488: Wrongly assumed undefined variable since 1.11.10

Fix phpstan/phpstan#11488: Wrongly assumed undefined variable since 1.11.10 #26497

Triggered via pull request March 8, 2026 17:58
Status Failure
Total duration 17m 20s
Artifacts

tests.yml

on: pull_request
Matrix: Tests PHPUnit 12.x
Determine levels tests matrix
47s
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

10 errors and 6 warnings
Tests PHPUnit 11.x (8.2, ubuntu-latest)
Process completed with exit code 2.
Tests with old PHPUnit (8.0, ubuntu-latest)
Process completed with exit code 2.
Tests with old PHPUnit (8.1, ubuntu-latest)
Process completed with exit code 2.
Tests with old PHPUnit (7.4, ubuntu-latest)
Process completed with exit code 2.
Tests PHPUnit 11.x (8.2, windows-latest)
Process completed with exit code 1.
Tests with old PHPUnit (8.0, windows-latest)
Process completed with exit code 1.
Tests with old PHPUnit (8.1, windows-latest)
Process completed with exit code 1.
Tests with old PHPUnit (7.4, windows-latest)
Process completed with exit code 1.
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/TypeSpecifier.php#L1381
Escaped Mutant for Mutator "PHPStan\Infection\TrinaryLogicMutator": @@ @@ $resultTypes[] = TypeCombinator::intersect($arrayType, new NonEmptyArrayType()); } - if ($context->falsey() && $isConstantArray->yes() && $allArraysHaveDefiniteSize) { + if ($context->falsey() && !$isConstantArray->no() && $allArraysHaveDefiniteSize) { if ($nonMatchingTypes === []) { return $this->create($countFuncCall->getArgs()[0]->value, new NeverType(), TypeSpecifierContext::createTrue(), $scope)->setAlwaysOverwriteTypes()->setRootExpr($rootExpr); }
Mutation Testing (8.4, ubuntu-latest): src/Analyser/TypeSpecifier.php#L1381
Escaped Mutant for Mutator "PHPStan\Infection\TrueTruthyFalseFalseyTypeSpecifierContextMutator": @@ @@ $resultTypes[] = TypeCombinator::intersect($arrayType, new NonEmptyArrayType()); } - if ($context->falsey() && $isConstantArray->yes() && $allArraysHaveDefiniteSize) { + if ($context->false() && $isConstantArray->yes() && $allArraysHaveDefiniteSize) { if ($nonMatchingTypes === []) { return $this->create($countFuncCall->getArgs()[0]->value, new NeverType(), TypeSpecifierContext::createTrue(), $scope)->setAlwaysOverwriteTypes()->setRootExpr($rootExpr); }
Mutation Testing (8.4, ubuntu-latest): src/Analyser/TypeSpecifier.php#L1278
Escaped Mutant for Mutator "PHPStan\Infection\TrinaryLogicMutator": @@ @@ $nonMatchingTypes = []; $allArraysHaveDefiniteSize = true; foreach ($type->getArrays() as $arrayType) { - if (!$arrayType->getArraySize()->isConstantScalarValue()->yes()) { + if ($arrayType->getArraySize()->isConstantScalarValue()->no()) { $allArraysHaveDefiniteSize = false; } $isSizeSuperTypeOfArraySize = $sizeType->isSuperTypeOf($arrayType->getArraySize());
Mutation Testing (8.3, ubuntu-latest): src/Analyser/TypeSpecifier.php#L1381
Escaped Mutant for Mutator "PHPStan\Infection\TrinaryLogicMutator": @@ @@ $resultTypes[] = TypeCombinator::intersect($arrayType, new NonEmptyArrayType()); } - if ($context->falsey() && $isConstantArray->yes() && $allArraysHaveDefiniteSize) { + if ($context->falsey() && !$isConstantArray->no() && $allArraysHaveDefiniteSize) { if ($nonMatchingTypes === []) { return $this->create($countFuncCall->getArgs()[0]->value, new NeverType(), TypeSpecifierContext::createTrue(), $scope)->setAlwaysOverwriteTypes()->setRootExpr($rootExpr); }
Mutation Testing (8.3, ubuntu-latest): src/Analyser/TypeSpecifier.php#L1381
Escaped Mutant for Mutator "PHPStan\Infection\TrueTruthyFalseFalseyTypeSpecifierContextMutator": @@ @@ $resultTypes[] = TypeCombinator::intersect($arrayType, new NonEmptyArrayType()); } - if ($context->falsey() && $isConstantArray->yes() && $allArraysHaveDefiniteSize) { + if ($context->false() && $isConstantArray->yes() && $allArraysHaveDefiniteSize) { if ($nonMatchingTypes === []) { return $this->create($countFuncCall->getArgs()[0]->value, new NeverType(), TypeSpecifierContext::createTrue(), $scope)->setAlwaysOverwriteTypes()->setRootExpr($rootExpr); }
Mutation Testing (8.3, ubuntu-latest): src/Analyser/TypeSpecifier.php#L1278
Escaped Mutant for Mutator "PHPStan\Infection\TrinaryLogicMutator": @@ @@ $nonMatchingTypes = []; $allArraysHaveDefiniteSize = true; foreach ($type->getArrays() as $arrayType) { - if (!$arrayType->getArraySize()->isConstantScalarValue()->yes()) { + if ($arrayType->getArraySize()->isConstantScalarValue()->no()) { $allArraysHaveDefiniteSize = false; } $isSizeSuperTypeOfArraySize = $sizeType->isSuperTypeOf($arrayType->getArraySize());