add Type::isError method #23722
Annotations
1 error and 11 warnings
|
Run infection
Process completed with exit code 1.
|
|
Run infection:
src/Rules/Arrays/NonexistentOffsetInArrayDimFetchCheck.php#L56
Escaped Mutant for Mutator "PHPStan\Infection\TrinaryLogicMutator":
@@ @@
{
$typeResult = $this->ruleLevelHelper->findTypeToCheck($scope, NullsafeOperatorHelper::getNullsafeShortcircuitedExprRespectingScope($scope, $var), $unknownClassPattern, static fn(Type $type): bool => $type->hasOffsetValueType($dimType)->yes());
$type = $typeResult->getType();
- if ($type->isError()->yes()) {
+ if (!$type->isError()->no()) {
return $typeResult->getUnknownClassErrors();
}
if ($scope->isInExpressionAssign($var) || $scope->isUndefinedExpressionAllowed($var)) {
|
|
Run infection:
src/Rules/Arrays/IterableInForeachRule.php#L42
Escaped Mutant for Mutator "PHPStan\Infection\TrinaryLogicMutator":
@@ @@
$originalNode = $node->getOriginalNode();
$typeResult = $this->ruleLevelHelper->findTypeToCheck($scope, $originalNode->expr, 'Iterating over an object of an unknown class %s.', static fn(Type $type): bool => $type->isIterable()->yes());
$type = $typeResult->getType();
- if ($type->isError()->yes()) {
+ if (!$type->isError()->no()) {
return $typeResult->getUnknownClassErrors();
}
if ($type->isIterable()->yes()) {
|
|
Run infection:
src/Rules/Arrays/InvalidKeyInArrayItemRule.php#L48
Escaped Mutant for Mutator "PHPStan\Infection\TrinaryLogicMutator":
@@ @@
}
$allowedArrayKeys = AllowedArrayKeysTypes::getType($this->phpVersion);
$dimensionType = $this->ruleLevelHelper->findTypeToCheck($scope, $node->key, '', static fn(Type $dimType): bool => $allowedArrayKeys->isSuperTypeOf($dimType)->yes())->getType();
- if ($dimensionType->isError()->yes()) {
+ if (!$dimensionType->isError()->no()) {
return [];
}
$isSuperType = $allowedArrayKeys->isSuperTypeOf($dimensionType);
|
|
Run infection:
src/Rules/Arrays/InvalidKeyInArrayDimFetchRule.php#L67
Escaped Mutant for Mutator "PHPStan\Infection\TrinaryLogicMutator":
@@ @@
}
$allowedArrayKeys = AllowedArrayKeysTypes::getType($this->phpVersion);
$dimensionType = $this->ruleLevelHelper->findTypeToCheck($scope, $node->dim, '', static fn(Type $dimType): bool => $allowedArrayKeys->isSuperTypeOf($dimType)->yes())->getType();
- if ($dimensionType->isError()->yes()) {
+ if (!$dimensionType->isError()->no()) {
return [];
}
$isSuperType = $allowedArrayKeys->isSuperTypeOf($dimensionType);
|
|
Run infection:
src/Rules/Arrays/InvalidKeyInArrayDimFetchRule.php#L51
Escaped Mutant for Mutator "PHPStan\Infection\TrinaryLogicMutator":
@@ @@
return [];
}
$varType = $this->ruleLevelHelper->findTypeToCheck($scope, $node->var, '', static fn(Type $varType): bool => $varType->isArray()->no())->getType();
- if ($varType->isError()->yes()) {
+ if (!$varType->isError()->no()) {
return [];
}
$isArray = $varType->isArray();
|
|
Run infection:
src/Rules/Arrays/ArrayDestructuringRule.php#L67
Escaped Mutant for Mutator "PHPStan\Infection\TrinaryLogicMutator":
@@ @@
{
$exprTypeResult = $this->ruleLevelHelper->findTypeToCheck($scope, $expr, '', static fn(Type $varType): bool => $varType->isArray()->yes() || (new ObjectType(ArrayAccess::class))->isSuperTypeOf($varType)->yes());
$exprType = $exprTypeResult->getType();
- if ($exprType->isError()->yes()) {
+ if (!$exprType->isError()->no()) {
return [];
}
if (!$exprType->isArray()->yes() && !(new ObjectType(ArrayAccess::class))->isSuperTypeOf($exprType)->yes()) {
|
|
Run infection:
src/Reflection/ResolvedFunctionVariantWithOriginal.php#L254
Escaped Mutant for Mutator "PHPStan\Infection\TrinaryLogicMutator":
@@ @@
}
if ($type instanceof TemplateType && !$type->isArgument()) {
$newType = $this->resolvedTemplateTypeMap->getType($type->getName());
- if ($newType === null || $newType->isError()->yes()) {
+ if ($newType === null || !$newType->isError()->no()) {
return $traverse($type);
}
$variance = TemplateTypeVariance::createInvariant();
|
|
Run infection:
src/Reflection/ResolvedFunctionVariantWithOriginal.php#L213
Escaped Mutant for Mutator "PHPStan\Infection\TrinaryLogicMutator":
@@ @@
$objectCb = function (Type $type, callable $traverse) use ($references): Type {
if ($type instanceof TemplateType && !$type->isArgument() && $type->getScope()->getFunctionName() !== null) {
$newType = $this->resolvedTemplateTypeMap->getType($type->getName());
- if ($newType === null || $newType->isError()->yes()) {
+ if ($newType === null || !$newType->isError()->no()) {
return $traverse($type);
}
$newType = TemplateTypeHelper::generalizeInferredTemplateType($type, $newType);
|
|
Run infection:
src/Reflection/Php/PhpClassReflectionExtension.php#L1163
Escaped Mutant for Mutator "PHPStan\Infection\TrinaryLogicMutator":
@@ @@
continue;
}
$propertyType = $methodScope->getType($expr->expr);
- if ($propertyType->isError()->yes() || $propertyType instanceof NeverType) {
+ if (!$propertyType->isError()->no() || $propertyType instanceof NeverType) {
continue;
}
$propertyType = $propertyType->generalize(GeneralizePrecision::lessSpecific());
|
|
Run infection:
src/Reflection/ClassReflection.php#L1646
Escaped Mutant for Mutator "PHPStan\Infection\TrinaryLogicMutator":
@@ @@
if ($resolved !== null) {
$templateTypeMap = $this->getTemplateTypeMap();
return $this->activeTemplateTypeMap = $resolved->map(static function (string $name, Type $type) use ($templateTypeMap): Type {
- if ($type->isError()->yes()) {
+ if (!$type->isError()->no()) {
$templateType = $templateTypeMap->getType($name);
if ($templateType !== null) {
return TemplateTypeHelper::resolveToDefaults($templateType);
|
|
Run /./build-infection/.github/actions/setup-php
Unexpected input(s) 'extensions', valid inputs are ['php-version', 'php-extensions', 'build-infection-path']
|
Loading