Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -1307,11 +1307,6 @@ parameters:
count: 1
path: src/Type/Php/ArrayCombineFunctionReturnTypeExtension.php

-
message: "#^Doing instanceof PHPStan\\\\Type\\\\Constant\\\\ConstantBooleanType is error\\-prone and deprecated\\. Use Type\\:\\:isTrue\\(\\) or Type\\:\\:isFalse\\(\\) instead\\.$#"
count: 1
path: src/Type/Php/ArrayFilterFunctionReturnTypeHelper.php

-
message: "#^Doing instanceof PHPStan\\\\Type\\\\Constant\\\\ConstantStringType is error\\-prone and deprecated\\. Use Type\\:\\:getConstantStrings\\(\\) instead\\.$#"
count: 1
Expand All @@ -1322,11 +1317,6 @@ parameters:
count: 4
path: src/Type/Php/ArrayMergeFunctionDynamicReturnTypeExtension.php

-
message: "#^Doing instanceof PHPStan\\\\Type\\\\Constant\\\\ConstantBooleanType is error\\-prone and deprecated\\. Use Type\\:\\:isTrue\\(\\) or Type\\:\\:isFalse\\(\\) instead\\.$#"
count: 1
path: src/Type/Php/ArraySearchFunctionDynamicReturnTypeExtension.php

-
message: "#^Doing instanceof PHPStan\\\\Type\\\\ConstantScalarType is error\\-prone and deprecated\\. Use Type\\:\\:isConstantScalarValue\\(\\) or Type\\:\\:getConstantScalarTypes\\(\\) or Type\\:\\:getConstantScalarValues\\(\\) instead\\.$#"
count: 16
Expand Down
3 changes: 1 addition & 2 deletions src/Type/Php/ArrayFilterFunctionReturnTypeHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
use PHPStan\Type\BenevolentUnionType;
use PHPStan\Type\Constant\ConstantArrayType;
use PHPStan\Type\Constant\ConstantArrayTypeBuilder;
use PHPStan\Type\Constant\ConstantBooleanType;
use PHPStan\Type\Constant\ConstantIntegerType;
use PHPStan\Type\ErrorType;
use PHPStan\Type\MixedType;
Expand Down Expand Up @@ -255,7 +254,7 @@ private function processKeyAndItemType(MutatingScope $scope, Type $keyType, Type
return [
$keyVarName !== null ? $scope->getVariableType($keyVarName) : $keyType,
$itemVarName !== null ? $scope->getVariableType($itemVarName) : $itemType,
!$booleanResult instanceof ConstantBooleanType,
!$booleanResult->isTrue()->yes(),
];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function getTypeFromFunctionCall(FunctionReflection $functionReflection,
}

$strictArgType = $scope->getType($functionCall->getArgs()[2]->value);
if (!$strictArgType instanceof ConstantBooleanType || $strictArgType->getValue() === false) {
if (!$strictArgType->isTrue()->yes()) {
return TypeCombinator::union($haystackArgType->getIterableKeyType(), new ConstantBooleanType(false));
}

Expand Down
Loading