Update dependency phpunit/phpunit to v12 #114
Annotations
21 warnings
|
phpstan-deprecation-rules:
src/Rules/Deprecations/RestrictedDeprecatedPropertyUsageExtension.php#L68
Escaped Mutant for Mutator "PHPStan\Infection\TrinaryLogicMutator":
@@ @@
}
return RestrictedUsage::create(sprintf("Access to %sproperty \$%s of deprecated %s %s:\n%s", $propertyReflection->isStatic() ? 'static ' : '', $propertyReflection->getName(), strtolower($propertyReflection->getDeclaringClass()->getClassTypeDescription()), $propertyReflection->getDeclaringClass()->getName(), $classDescription), sprintf('%s.deprecated%s', $propertyReflection->isStatic() ? 'staticProperty' : 'property', $propertyReflection->getDeclaringClass()->getClassTypeDescription()));
}
- if (!$propertyReflection->isDeprecated()->yes()) {
+ if ($propertyReflection->isDeprecated()->no()) {
return null;
}
$description = $propertyReflection->getDeprecatedDescription();
|
|
phpstan-deprecation-rules:
src/Rules/Deprecations/RestrictedDeprecatedMethodUsageExtension.php#L66
Escaped Mutant for Mutator "PHPStan\Infection\TrinaryLogicMutator":
@@ @@
}
return RestrictedUsage::create(sprintf("Call to method %s() of deprecated %s %s:\n%s", $methodReflection->getName(), strtolower($methodReflection->getDeclaringClass()->getClassTypeDescription()), $methodReflection->getDeclaringClass()->getName(), $classDescription), sprintf('%s.deprecated%s', $methodReflection->isStatic() ? 'staticMethod' : 'method', $methodReflection->getDeclaringClass()->getClassTypeDescription()));
}
- if (!$methodReflection->isDeprecated()->yes()) {
+ if ($methodReflection->isDeprecated()->no()) {
return null;
}
$description = $methodReflection->getDeprecatedDescription();
|
|
phpstan-deprecation-rules:
src/Rules/Deprecations/RestrictedDeprecatedFunctionUsageExtension.php#L30
Escaped Mutant for Mutator "PHPStan\Infection\TrinaryLogicMutator":
@@ @@
if ($this->deprecatedScopeHelper->isScopeDeprecated($scope)) {
return null;
}
- if (!$functionReflection->isDeprecated()->yes()) {
+ if ($functionReflection->isDeprecated()->no()) {
return null;
}
$description = $functionReflection->getDeprecatedDescription();
|
|
phpstan-deprecation-rules:
src/Rules/Deprecations/RestrictedDeprecatedClassNameUsageExtension.php#L110
Escaped Mutant for Mutator "PHPStan\Infection\TrinaryLogicMutator":
@@ @@
if ($location->value === ClassNameUsageLocation::CLASS_CONSTANT_ACCESS) {
$constant = $location->getClassConstant();
if ($constant !== null) {
- if ($constant->isDeprecated()->yes() || $constant->getDeclaringClass()->isDeprecated()) {
+ if (!$constant->isDeprecated()->no() || $constant->getDeclaringClass()->isDeprecated()) {
return null;
}
}
|
|
phpstan-deprecation-rules:
src/Rules/Deprecations/RestrictedDeprecatedClassNameUsageExtension.php#L88
Escaped Mutant for Mutator "PHPStan\Infection\TrinaryLogicMutator":
@@ @@
if ($location->value === ClassNameUsageLocation::STATIC_METHOD_CALL) {
$method = $location->getMethod();
if ($method !== null) {
- if ($method->isDeprecated()->yes() || $method->getDeclaringClass()->isDeprecated()) {
+ if (!$method->isDeprecated()->no() || $method->getDeclaringClass()->isDeprecated()) {
return null;
}
}
|
|
phpstan-deprecation-rules:
src/Rules/Deprecations/RestrictedDeprecatedClassConstantUsageExtension.php#L64
Escaped Mutant for Mutator "PHPStan\Infection\TrinaryLogicMutator":
@@ @@
}
return RestrictedUsage::create(sprintf("Fetching class constant %s of deprecated %s %s:\n%s", $constantReflection->getName(), strtolower($constantReflection->getDeclaringClass()->getClassTypeDescription()), $constantReflection->getDeclaringClass()->getName(), $classDescription), sprintf('classConstant.deprecated%s', $constantReflection->getDeclaringClass()->getClassTypeDescription()));
}
- if (!$constantReflection->isDeprecated()->yes()) {
+ if ($constantReflection->isDeprecated()->no()) {
return null;
}
$description = $constantReflection->getDeprecatedDescription();
|
|
phpstan-deprecation-rules:
src/Rules/Deprecations/DefaultDeprecatedScopeResolver.php#L23
Escaped Mutant for Mutator "PHPStan\Infection\TrinaryLogicMutator":
@@ @@
return true;
}
$function = $scope->getFunction();
- if ($function !== null && $function->isDeprecated()->yes()) {
+ if ($function !== null && !$function->isDeprecated()->no()) {
return true;
}
return false;
}
}
|
|
phpstan-phpunit:
src/Rules/PHPUnit/DataProviderDataRule.php#L143
Escaped Mutant for Mutator "PHPStan\Infection\TrinaryLogicMutator":
@@ @@
if ($constArrays !== [] && count($constArrays) === 1) {
$keyTypes = $constArrays[0]->getKeyTypes();
$valueTypes = $constArrays[0]->getValueTypes();
- } elseif ($array->isArray()->yes()) {
+ } elseif (!$array->isArray()->no()) {
$keyTypes = [];
$valueTypes = [];
for ($i = 0; $i < $numberOfParameters; ++$i) {
|
|
phpstan-phpunit:
src/Rules/PHPUnit/AssertSameWithCountRule.php#L93
Escaped Mutant for Mutator "PHPStan\Infection\TrinaryLogicMutator":
@@ @@
{
if ($expr instanceof Node\Expr\MethodCall && $expr->name instanceof Node\Identifier && $expr->name->toLowerString() === 'count' && count($expr->getArgs()) === 0) {
$type = $scope->getType($expr->var);
- if ((new ObjectType(Countable::class))->isSuperTypeOf($type)->yes()) {
+ if (!(new ObjectType(Countable::class))->isSuperTypeOf($type)->no()) {
return true;
}
}
|
|
phpstan-phpunit:
src/Rules/PHPUnit/AssertRuleHelper.php#L46
Escaped Mutant for Mutator "PHPStan\Infection\TrinaryLogicMutator":
@@ @@
return false;
}
$testCaseType = new ObjectType('PHPUnit\Framework\Assert');
- return $testCaseType->isSuperTypeOf($calledOnType)->yes();
+ return !$testCaseType->isSuperTypeOf($calledOnType)->no();
}
}
|
|
phpstan-phpunit:
src/Rules/PHPUnit/AssertEqualsIsDiscouragedRule.php#L64
Escaped Mutant for Mutator "PHPStan\Infection\TrinaryLogicMutator":
@@ @@
if ($rightType->isConstantScalarValue()->yes()) {
$rightType = $rightType->generalize(GeneralizePrecision::lessSpecific());
}
- if ($leftType->isScalar()->yes() && $rightType->isScalar()->yes() && $leftType->isSuperTypeOf($rightType)->yes() && $rightType->isSuperTypeOf($leftType)->yes()) {
+ if ($leftType->isScalar()->yes() && $rightType->isScalar()->yes() && $leftType->isSuperTypeOf($rightType)->yes() && !$rightType->isSuperTypeOf($leftType)->no()) {
$correctName = strtolower($node->name->name) === 'assertnotequals' ? 'assertNotSame' : 'assertSame';
return [RuleErrorBuilder::message(sprintf('You should use %s() instead of %s(), because both values are scalars of the same type', $correctName, $node->name->name))->identifier('phpunit.assertEquals')->fixNode($node, static function (CallLike $node) use ($correctName) {
$node->name = new Node\Identifier($correctName);
|
|
phpstan-phpunit:
src/Rules/PHPUnit/AssertEqualsIsDiscouragedRule.php#L63
Escaped Mutant for Mutator "PHPStan\Infection\TrinaryLogicMutator":
@@ @@
if ($rightType->isConstantScalarValue()->yes()) {
$rightType = $rightType->generalize(GeneralizePrecision::lessSpecific());
}
- if ($leftType->isScalar()->yes() && $rightType->isScalar()->yes() && $leftType->isSuperTypeOf($rightType)->yes() && $rightType->isSuperTypeOf($leftType)->yes()) {
+ if ($leftType->isScalar()->yes() && $rightType->isScalar()->yes() && !$leftType->isSuperTypeOf($rightType)->no() && $rightType->isSuperTypeOf($leftType)->yes()) {
$correctName = strtolower($node->name->name) === 'assertnotequals' ? 'assertNotSame' : 'assertSame';
return [RuleErrorBuilder::message(sprintf('You should use %s() instead of %s(), because both values are scalars of the same type', $correctName, $node->name->name))->identifier('phpunit.assertEquals')->fixNode($node, static function (CallLike $node) use ($correctName) {
$node->name = new Node\Identifier($correctName);
|
|
phpstan-phpunit:
src/Rules/PHPUnit/AssertEqualsIsDiscouragedRule.php#L62
Escaped Mutant for Mutator "PHPStan\Infection\TrinaryLogicMutator":
@@ @@
if ($rightType->isConstantScalarValue()->yes()) {
$rightType = $rightType->generalize(GeneralizePrecision::lessSpecific());
}
- if ($leftType->isScalar()->yes() && $rightType->isScalar()->yes() && $leftType->isSuperTypeOf($rightType)->yes() && $rightType->isSuperTypeOf($leftType)->yes()) {
+ if ($leftType->isScalar()->yes() && !$rightType->isScalar()->no() && $leftType->isSuperTypeOf($rightType)->yes() && $rightType->isSuperTypeOf($leftType)->yes()) {
$correctName = strtolower($node->name->name) === 'assertnotequals' ? 'assertNotSame' : 'assertSame';
return [RuleErrorBuilder::message(sprintf('You should use %s() instead of %s(), because both values are scalars of the same type', $correctName, $node->name->name))->identifier('phpunit.assertEquals')->fixNode($node, static function (CallLike $node) use ($correctName) {
$node->name = new Node\Identifier($correctName);
|
|
phpstan-phpunit:
src/Rules/PHPUnit/AssertEqualsIsDiscouragedRule.php#L62
Escaped Mutant for Mutator "PHPStan\Infection\TrinaryLogicMutator":
@@ @@
if ($rightType->isConstantScalarValue()->yes()) {
$rightType = $rightType->generalize(GeneralizePrecision::lessSpecific());
}
- if ($leftType->isScalar()->yes() && $rightType->isScalar()->yes() && $leftType->isSuperTypeOf($rightType)->yes() && $rightType->isSuperTypeOf($leftType)->yes()) {
+ if (!$leftType->isScalar()->no() && $rightType->isScalar()->yes() && $leftType->isSuperTypeOf($rightType)->yes() && $rightType->isSuperTypeOf($leftType)->yes()) {
$correctName = strtolower($node->name->name) === 'assertnotequals' ? 'assertNotSame' : 'assertSame';
return [RuleErrorBuilder::message(sprintf('You should use %s() instead of %s(), because both values are scalars of the same type', $correctName, $node->name->name))->identifier('phpunit.assertEquals')->fixNode($node, static function (CallLike $node) use ($correctName) {
$node->name = new Node\Identifier($correctName);
|
|
phpstan-phpunit:
src/Rules/PHPUnit/AssertEqualsIsDiscouragedRule.php#L57
Escaped Mutant for Mutator "PHPStan\Infection\TrinaryLogicMutator":
@@ @@
if ($leftType->isConstantScalarValue()->yes()) {
$leftType = $leftType->generalize(GeneralizePrecision::lessSpecific());
}
- if ($rightType->isConstantScalarValue()->yes()) {
+ if (!$rightType->isConstantScalarValue()->no()) {
$rightType = $rightType->generalize(GeneralizePrecision::lessSpecific());
}
if ($leftType->isScalar()->yes() && $rightType->isScalar()->yes() && $leftType->isSuperTypeOf($rightType)->yes() && $rightType->isSuperTypeOf($leftType)->yes()) {
|
|
phpstan-phpunit:
src/Rules/PHPUnit/AssertEqualsIsDiscouragedRule.php#L54
Escaped Mutant for Mutator "PHPStan\Infection\TrinaryLogicMutator":
@@ @@
}
$leftType = TypeCombinator::removeNull($scope->getType($node->getArgs()[0]->value));
$rightType = TypeCombinator::removeNull($scope->getType($node->getArgs()[1]->value));
- if ($leftType->isConstantScalarValue()->yes()) {
+ if (!$leftType->isConstantScalarValue()->no()) {
$leftType = $leftType->generalize(GeneralizePrecision::lessSpecific());
}
if ($rightType->isConstantScalarValue()->yes()) {
|
|
phpstan-src:
src/Analyser/LegacyTypeSpecifier.php#L791
Escaped Mutant for Mutator "PHPStan\Infection\TrinaryLogicMutator":
@@ @@
if ($expr->expr instanceof FuncCall && $expr->expr->name instanceof Name && $expr->expr->name->toLowerString() === 'array_search' && count($expr->expr->getArgs()) >= 2) {
$arrayArg = $expr->expr->getArgs()[1]->value;
$arrayType = $scope->getType($arrayArg);
- if ($arrayType->isArray()->yes()) {
+ if (!$arrayType->isArray()->no()) {
$dimFetch = new ArrayDimFetch($arrayArg, $expr->var);
$iterableValueType = $arrayType->getIterableValueType();
return $specifiedTypes->unionWith($this->create($dimFetch, $iterableValueType, TypeSpecifierContext::createTrue(), $scope));
@@ @@
return $this->specifyTypesInCondition($scope, new BooleanOr(new Expr\BooleanNot(new Expr\Isset_([$expr->expr])), new Expr\BooleanNot($expr->expr)), $context)->setRootExpr($expr);
} elseif ($expr instanceof Expr\ErrorSuppress) {
return $this->specifyTypesInCondition($scope, $expr->expr, $context)->setRootExpr($expr);
- } elseif ($expr instanceof Expr\Ternary && !$context->null() && $scope->getType($expr->else)->toBoolean()->isFalse()->yes()) {
+ } elseif ($expr instanceof Expr\Ternary && !$context->null() && $scope->getType($expr->else)->isFalse()->yes()) {
$conditionExpr = $expr->cond;
if ($expr->if !== null) {
$conditionExpr = new BooleanAnd($conditionExpr, $expr->if);
@@ @@
}
private function specifyTypesForConstantBinaryExpression(Expr $exprNode, Type $constantType, TypeSpecifierContext $context, Scope $scope, Expr $rootExpr): ?SpecifiedTypes
{
- if (!$context->null() && $constantType->toBoolean()->isFalse()->yes()) {
+ if (!$context->null() && $constantType->isFalse()->yes()) {
$types = $this->create($exprNode, $constantType, $context, $scope)->setRootExpr($rootExpr);
if (!$context->true() && ($exprNode instanceof Expr\NullsafeMethodCall || $exprNode instanceof Expr\NullsafePropertyFetch)) {
return $types;
@@ @@
}
return $types->unionWith($this->specifyTypesInCondition($scope, $exprNode, $context->true() ? TypeSpecifierContext::createFalse() : TypeSpecifierContext::createFalse()->negate())->setRootExpr($rootExpr));
}
- if (!$context->null() && $constantType->toBoolean()->isTrue()->yes()) {
+ if (!$context->null() && $constantType->isTrue()->yes()) {
$types = $this->create($exprNode, $constantType, $context, $scope)->setRootExpr($rootExpr);
if (!$context->true() && ($exprNode instanceof Expr\NullsafeMethodCall || $exprNode instanceof Expr\NullsafePropertyFetch)) {
return $types;
|
|
phpstan-src:
src/Analyser/LegacyTypeSpecifier.php#L765
Escaped Mutant for Mutator "PHPStan\Infection\TrinaryLogicMutator":
@@ @@
if ($expr->expr instanceof Expr\BinaryOp\Minus && $expr->expr->left instanceof FuncCall && $expr->expr->left->name instanceof Name && in_array($expr->expr->left->name->toLowerString(), ['count', 'sizeof'], true) && count($expr->expr->left->getArgs()) >= 1 && $expr->expr->right instanceof Node\Scalar\Int_ && $expr->expr->right->value === 1) {
$arrayArg = $expr->expr->left->getArgs()[0]->value;
$arrayType = $scope->getType($arrayArg);
- if ($arrayType->isList()->yes() && $arrayType->isIterableAtLeastOnce()->yes()) {
+ if ($arrayType->isList()->yes() && !$arrayType->isIterableAtLeastOnce()->no()) {
$dimFetch = new ArrayDimFetch($arrayArg, $expr->var);
return $specifiedTypes->unionWith($this->create($dimFetch, $arrayType->getIterableValueType(), TypeSpecifierContext::createTrue(), $scope));
}
@@ @@
return $this->specifyTypesInCondition($scope, new BooleanOr(new Expr\BooleanNot(new Expr\Isset_([$expr->expr])), new Expr\BooleanNot($expr->expr)), $context)->setRootExpr($expr);
} elseif ($expr instanceof Expr\ErrorSuppress) {
return $this->specifyTypesInCondition($scope, $expr->expr, $context)->setRootExpr($expr);
- } elseif ($expr instanceof Expr\Ternary && !$context->null() && $scope->getType($expr->else)->toBoolean()->isFalse()->yes()) {
+ } elseif ($expr instanceof Expr\Ternary && !$context->null() && $scope->getType($expr->else)->isFalse()->yes()) {
$conditionExpr = $expr->cond;
if ($expr->if !== null) {
$conditionExpr = new BooleanAnd($conditionExpr, $expr->if);
@@ @@
}
private function specifyTypesForConstantBinaryExpression(Expr $exprNode, Type $constantType, TypeSpecifierContext $context, Scope $scope, Expr $rootExpr): ?SpecifiedTypes
{
- if (!$context->null() && $constantType->toBoolean()->isFalse()->yes()) {
+ if (!$context->null() && $constantType->isFalse()->yes()) {
$types = $this->create($exprNode, $constantType, $context, $scope)->setRootExpr($rootExpr);
if (!$context->true() && ($exprNode instanceof Expr\NullsafeMethodCall || $exprNode instanceof Expr\NullsafePropertyFetch)) {
return $types;
@@ @@
}
return $types->unionWith($this->specifyTypesInCondition($scope, $exprNode, $context->true() ? TypeSpecifierContext::createFalse() : TypeSpecifierContext::createFalse()->negate())->setRootExpr($rootExpr));
}
- if (!$context->null() && $constantType->toBoolean()->isTrue()->yes()) {
+ if (!$context->null() && $constantType->isTrue()->yes()) {
$types = $this->create($exprNode, $constantType, $context, $scope)->setRootExpr($rootExpr);
if (!$context->true() && ($exprNode instanceof Expr\NullsafeMethodCall || $exprNode instanceof Expr\NullsafePropertyFetch)) {
return $types;
|
|
phpstan-src:
src/Analyser/LegacyTypeSpecifier.php#L738
Escaped Mutant for Mutator "PHPStan\Infection\TrinaryLogicMutator":
@@ @@
if ($expr->expr instanceof FuncCall && $expr->expr->name instanceof Name && in_array($expr->expr->name->toLowerString(), ['array_key_first', 'array_key_last'], true) && count($expr->expr->getArgs()) >= 1) {
$arrayArg = $expr->expr->getArgs()[0]->value;
$arrayType = $scope->getType($arrayArg);
- if ($arrayType->isArray()->yes() && $arrayType->isIterableAtLeastOnce()->yes()) {
+ if ($arrayType->isArray()->yes() && !$arrayType->isIterableAtLeastOnce()->no()) {
$dimFetch = new ArrayDimFetch($arrayArg, $expr->var);
$iterableValueType = $expr->expr->name->toLowerString() === 'array_key_first' ? $arrayType->getIterableValueType() : $arrayType->getIterableValueType();
return $specifiedTypes->unionWith($this->create($dimFetch, $iterableValueType, TypeSpecifierContext::createTrue(), $scope));
@@ @@
return $this->specifyTypesInCondition($scope, new BooleanOr(new Expr\BooleanNot(new Expr\Isset_([$expr->expr])), new Expr\BooleanNot($expr->expr)), $context)->setRootExpr($expr);
} elseif ($expr instanceof Expr\ErrorSuppress) {
return $this->specifyTypesInCondition($scope, $expr->expr, $context)->setRootExpr($expr);
- } elseif ($expr instanceof Expr\Ternary && !$context->null() && $scope->getType($expr->else)->toBoolean()->isFalse()->yes()) {
+ } elseif ($expr instanceof Expr\Ternary && !$context->null() && $scope->getType($expr->else)->isFalse()->yes()) {
$conditionExpr = $expr->cond;
if ($expr->if !== null) {
$conditionExpr = new BooleanAnd($conditionExpr, $expr->if);
@@ @@
}
private function specifyTypesForConstantBinaryExpression(Expr $exprNode, Type $constantType, TypeSpecifierContext $context, Scope $scope, Expr $rootExpr): ?SpecifiedTypes
{
- if (!$context->null() && $constantType->toBoolean()->isFalse()->yes()) {
+ if (!$context->null() && $constantType->isFalse()->yes()) {
$types = $this->create($exprNode, $constantType, $context, $scope)->setRootExpr($rootExpr);
if (!$context->true() && ($exprNode instanceof Expr\NullsafeMethodCall || $exprNode instanceof Expr\NullsafePropertyFetch)) {
return $types;
@@ @@
}
return $types->unionWith($this->specifyTypesInCondition($scope, $exprNode, $context->true() ? TypeSpecifierContext::createFalse() : TypeSpecifierContext::createFalse()->negate())->setRootExpr($rootExpr));
}
- if (!$context->null() && $constantType->toBoolean()->isTrue()->yes()) {
+ if (!$context->null() && $constantType->isTrue()->yes()) {
$types = $this->create($exprNode, $constantType, $context, $scope)->setRootExpr($rootExpr);
if (!$context->true() && ($exprNode instanceof Expr\NullsafeMethodCall || $exprNode instanceof Expr\NullsafePropertyFetch)) {
return $types;
|
|
phpstan-src:
src/Analyser/LegacyTypeSpecifier.php#L737
Escaped Mutant for Mutator "PHPStan\Infection\TrinaryLogicMutator":
@@ @@
if ($expr->expr instanceof FuncCall && $expr->expr->name instanceof Name && in_array($expr->expr->name->toLowerString(), ['array_key_first', 'array_key_last'], true) && count($expr->expr->getArgs()) >= 1) {
$arrayArg = $expr->expr->getArgs()[0]->value;
$arrayType = $scope->getType($arrayArg);
- if ($arrayType->isArray()->yes() && $arrayType->isIterableAtLeastOnce()->yes()) {
+ if (!$arrayType->isArray()->no() && $arrayType->isIterableAtLeastOnce()->yes()) {
$dimFetch = new ArrayDimFetch($arrayArg, $expr->var);
$iterableValueType = $expr->expr->name->toLowerString() === 'array_key_first' ? $arrayType->getIterableValueType() : $arrayType->getIterableValueType();
return $specifiedTypes->unionWith($this->create($dimFetch, $iterableValueType, TypeSpecifierContext::createTrue(), $scope));
@@ @@
return $this->specifyTypesInCondition($scope, new BooleanOr(new Expr\BooleanNot(new Expr\Isset_([$expr->expr])), new Expr\BooleanNot($expr->expr)), $context)->setRootExpr($expr);
} elseif ($expr instanceof Expr\ErrorSuppress) {
return $this->specifyTypesInCondition($scope, $expr->expr, $context)->setRootExpr($expr);
- } elseif ($expr instanceof Expr\Ternary && !$context->null() && $scope->getType($expr->else)->toBoolean()->isFalse()->yes()) {
+ } elseif ($expr instanceof Expr\Ternary && !$context->null() && $scope->getType($expr->else)->isFalse()->yes()) {
$conditionExpr = $expr->cond;
if ($expr->if !== null) {
$conditionExpr = new BooleanAnd($conditionExpr, $expr->if);
@@ @@
}
private function specifyTypesForConstantBinaryExpression(Expr $exprNode, Type $constantType, TypeSpecifierContext $context, Scope $scope, Expr $rootExpr): ?SpecifiedTypes
{
- if (!$context->null() && $constantType->toBoolean()->isFalse()->yes()) {
+ if (!$context->null() && $constantType->isFalse()->yes()) {
$types = $this->create($exprNode, $constantType, $context, $scope)->setRootExpr($rootExpr);
if (!$context->true() && ($exprNode instanceof Expr\NullsafeMethodCall || $exprNode instanceof Expr\NullsafePropertyFetch)) {
return $types;
@@ @@
}
return $types->unionWith($this->specifyTypesInCondition($scope, $exprNode, $context->true() ? TypeSpecifierContext::createFalse() : TypeSpecifierContext::createFalse()->negate())->setRootExpr($rootExpr));
}
- if (!$context->null() && $constantType->toBoolean()->isTrue()->yes()) {
+ if (!$context->null() && $constantType->isTrue()->yes()) {
$types = $this->create($exprNode, $constantType, $context, $scope)->setRootExpr($rootExpr);
if (!$context->true() && ($exprNode instanceof Expr\NullsafeMethodCall || $exprNode instanceof Expr\NullsafePropertyFetch)) {
return $types;
|
|
phpstan-src:
src/Analyser/Generator/SpecifiedTypesHelper.php#L88
Escaped Mutant for Mutator "PHPStan\Infection\TrueTruthyFalseFalseyTypeSpecifierContextMutator":
@@ @@
$sureTypes = [];
$sureNotTypes = [];
$exprString = $this->exprPrinter->printExpr($expr);
- if ($context->false()) {
+ if ($context->falsey()) {
$sureNotTypes[$exprString] = [$expr, $type];
} elseif ($context->true()) {
$sureTypes[$exprString] = [$expr, $type];
|