Skip to content

Commit a2d5bb1

Browse files
committed
Merge remote-tracking branch 'origin/1.12.x' into 2.1.x
2 parents 82a6961 + fd7bad3 commit a2d5bb1

File tree

3 files changed

+2
-15
lines changed

3 files changed

+2
-15
lines changed

phpstan-baseline.neon

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1455,12 +1455,6 @@ parameters:
14551455
count: 1
14561456
path: src/Type/Php/ArrayCombineFunctionReturnTypeExtension.php
14571457

1458-
-
1459-
message: '#^Doing instanceof PHPStan\\Type\\Constant\\ConstantBooleanType is error\-prone and deprecated\. Use Type\:\:isTrue\(\) or Type\:\:isFalse\(\) instead\.$#'
1460-
identifier: phpstanApi.instanceofType
1461-
count: 1
1462-
path: src/Type/Php/ArrayFilterFunctionReturnTypeHelper.php
1463-
14641458
-
14651459
message: '#^Doing instanceof PHPStan\\Type\\Constant\\ConstantStringType is error\-prone and deprecated\. Use Type\:\:getConstantStrings\(\) instead\.$#'
14661460
identifier: phpstanApi.instanceofType
@@ -1473,12 +1467,6 @@ parameters:
14731467
count: 4
14741468
path: src/Type/Php/ArrayMergeFunctionDynamicReturnTypeExtension.php
14751469

1476-
-
1477-
message: '#^Doing instanceof PHPStan\\Type\\Constant\\ConstantBooleanType is error\-prone and deprecated\. Use Type\:\:isTrue\(\) or Type\:\:isFalse\(\) instead\.$#'
1478-
identifier: phpstanApi.instanceofType
1479-
count: 1
1480-
path: src/Type/Php/ArraySearchFunctionDynamicReturnTypeExtension.php
1481-
14821470
-
14831471
message: '#^Doing instanceof PHPStan\\Type\\ConstantScalarType is error\-prone and deprecated\. Use Type\:\:isConstantScalarValue\(\) or Type\:\:getConstantScalarTypes\(\) or Type\:\:getConstantScalarValues\(\) instead\.$#'
14841472
identifier: phpstanApi.instanceofType

src/Type/Php/ArrayFilterFunctionReturnTypeHelper.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
use PHPStan\Type\BenevolentUnionType;
2323
use PHPStan\Type\Constant\ConstantArrayType;
2424
use PHPStan\Type\Constant\ConstantArrayTypeBuilder;
25-
use PHPStan\Type\Constant\ConstantBooleanType;
2625
use PHPStan\Type\Constant\ConstantIntegerType;
2726
use PHPStan\Type\ErrorType;
2827
use PHPStan\Type\MixedType;
@@ -256,7 +255,7 @@ private function processKeyAndItemType(MutatingScope $scope, Type $keyType, Type
256255
return [
257256
$keyVarName !== null ? $scope->getVariableType($keyVarName) : $keyType,
258257
$itemVarName !== null ? $scope->getVariableType($itemVarName) : $itemType,
259-
!$booleanResult instanceof ConstantBooleanType,
258+
!$booleanResult->isTrue()->yes(),
260259
];
261260
}
262261

src/Type/Php/ArraySearchFunctionDynamicReturnTypeExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function getTypeFromFunctionCall(FunctionReflection $functionReflection,
4343
}
4444

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

0 commit comments

Comments
 (0)