Skip to content

Commit 94bbb6d

Browse files
committed
Merge branch 2.1.x into 2.2.x
2 parents 51b0ae1 + 9c915ec commit 94bbb6d

File tree

2 files changed

+2
-17
lines changed

2 files changed

+2
-17
lines changed

phpstan-baseline.neon

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1716,7 +1716,7 @@ parameters:
17161716
-
17171717
rawMessage: 'Doing instanceof PHPStan\Type\Constant\ConstantStringType is error-prone and deprecated. Use Type::getConstantStrings() instead.'
17181718
identifier: phpstanApi.instanceofType
1719-
count: 3
1719+
count: 2
17201720
path: src/Type/TypeCombinator.php
17211721

17221722
-
@@ -1749,18 +1749,6 @@ parameters:
17491749
count: 2
17501750
path: src/Type/TypeCombinator.php
17511751

1752-
-
1753-
rawMessage: Instanceof between PHPStan\Type\Constant\ConstantIntegerType and PHPStan\Type\Constant\ConstantIntegerType will always evaluate to true.
1754-
identifier: instanceof.alwaysTrue
1755-
count: 1
1756-
path: src/Type/TypeCombinator.php
1757-
1758-
-
1759-
rawMessage: Result of || is always true.
1760-
identifier: booleanOr.alwaysTrue
1761-
count: 1
1762-
path: src/Type/TypeCombinator.php
1763-
17641752
-
17651753
rawMessage: Doing instanceof PHPStan\Type\IntersectionType is error-prone and deprecated.
17661754
identifier: phpstanApi.instanceofType

src/Type/TypeCombinator.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -825,10 +825,7 @@ private static function processArrayAccessoryTypes(array $arrayTypes): array
825825
continue;
826826
}
827827
if ($innerType instanceof HasOffsetType) {
828-
$offset = $innerType->getOffsetType();
829-
if ($offset instanceof ConstantStringType || $offset instanceof ConstantIntegerType) {
830-
$innerType = new HasOffsetValueType($offset, $arrayType->getIterableValueType());
831-
}
828+
$innerType = new HasOffsetValueType($innerType->getOffsetType(), $arrayType->getIterableValueType());
832829
}
833830
if ($innerType instanceof HasOffsetValueType) {
834831
$accessoryTypes[sprintf('hasOffsetValue(%s)', $innerType->getOffsetType()->describe(VerbosityLevel::cache()))][$i] = $innerType;

0 commit comments

Comments
 (0)